blob: cee3ed2b2de56bbe779a3e8a5461a0f53318894a [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
stefan@webrtc.org439be292012-02-16 14:45:37 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
mflodman@webrtc.orge06ca3c2012-06-29 13:20:14 +000011#ifndef WEBRTC_VIDEO_ENGINE_VIE_CODEC_IMPL_H_
12#define WEBRTC_VIDEO_ENGINE_VIE_CODEC_IMPL_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
pbos@webrtc.orgf5d4cb12013-05-17 13:44:48 +000014#include "webrtc/typedefs.h"
15#include "webrtc/video_engine/include/vie_codec.h"
16#include "webrtc/video_engine/vie_defines.h"
17#include "webrtc/video_engine/vie_ref_count.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000018
mflodman@webrtc.orgc12686c2011-12-21 09:29:28 +000019namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000020
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000021class ViESharedData;
22
mflodman@webrtc.orgc12686c2011-12-21 09:29:28 +000023class ViECodecImpl
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000024 : public ViECodec,
mflodman@webrtc.orgc12686c2011-12-21 09:29:28 +000025 public ViERefCount {
26 public:
27 virtual int Release();
niklase@google.com470e71d2011-07-07 08:21:25 +000028
mflodman@webrtc.orgc12686c2011-12-21 09:29:28 +000029 // Implements ViECodec.
30 virtual int NumberOfCodecs() const;
31 virtual int GetCodec(const unsigned char list_number,
32 VideoCodec& video_codec) const;
33 virtual int SetSendCodec(const int video_channel,
34 const VideoCodec& video_codec);
35 virtual int GetSendCodec(const int video_channel,
36 VideoCodec& video_codec) const;
37 virtual int SetReceiveCodec(const int video_channel,
38 const VideoCodec& video_codec);
39 virtual int GetReceiveCodec(const int video_channel,
40 VideoCodec& video_codec) const;
41 virtual int GetCodecConfigParameters(
42 const int video_channel,
43 unsigned char config_parameters[kConfigParameterSize],
44 unsigned char& config_parameters_size) const;
45 virtual int SetImageScaleStatus(const int video_channel, const bool enable);
46 virtual int GetSendCodecStastistics(const int video_channel,
47 unsigned int& key_frames,
48 unsigned int& delta_frames) const;
49 virtual int GetReceiveCodecStastistics(const int video_channel,
50 unsigned int& key_frames,
51 unsigned int& delta_frames) const;
mflodman@webrtc.org4aee6b62012-12-14 14:02:10 +000052 virtual int GetReceiveSideDelay(const int video_channel,
53 int* delay_ms) const;
stefan@webrtc.org439be292012-02-16 14:45:37 +000054 virtual int GetCodecTargetBitrate(const int video_channel,
55 unsigned int* bitrate) const;
mflodman@webrtc.orgc12686c2011-12-21 09:29:28 +000056 virtual unsigned int GetDiscardedPackets(const int video_channel) const;
57 virtual int SetKeyFrameRequestCallbackStatus(const int video_channel,
58 const bool enable);
59 virtual int SetSignalKeyPacketLossStatus(const int video_channel,
60 const bool enable,
61 const bool only_key_frames = false);
62 virtual int RegisterEncoderObserver(const int video_channel,
63 ViEEncoderObserver& observer);
64 virtual int DeregisterEncoderObserver(const int video_channel);
65 virtual int RegisterDecoderObserver(const int video_channel,
66 ViEDecoderObserver& observer);
67 virtual int DeregisterDecoderObserver(const int video_channel);
68 virtual int SendKeyFrame(const int video_channel);
69 virtual int WaitForFirstKeyFrame(const int video_channel, const bool wait);
mflodman@webrtc.org1c986e72013-06-26 09:12:49 +000070 virtual int StartDebugRecording(int video_channel,
71 const char* file_name_utf8);
72 virtual int StopDebugRecording(int video_channel);
henrik.lundin@webrtc.orgce8e0932013-11-18 12:18:43 +000073 virtual void SuspendBelowMinBitrate(int video_channel);
stefan@webrtc.org0a3c1472013-12-05 14:05:07 +000074 virtual bool GetSendSideDelay(int video_channel, int* avg_delay_ms,
75 int* max_delay_ms) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000076
mflodman@webrtc.orgc12686c2011-12-21 09:29:28 +000077 protected:
mflodman@webrtc.org9ba151b2012-06-21 10:02:13 +000078 explicit ViECodecImpl(ViESharedData* shared_data);
mflodman@webrtc.orgc12686c2011-12-21 09:29:28 +000079 virtual ~ViECodecImpl();
niklase@google.com470e71d2011-07-07 08:21:25 +000080
mflodman@webrtc.orgc12686c2011-12-21 09:29:28 +000081 private:
82 bool CodecValid(const VideoCodec& video_codec);
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000083
84 ViESharedData* shared_data_;
niklase@google.com470e71d2011-07-07 08:21:25 +000085};
niklase@google.com470e71d2011-07-07 08:21:25 +000086
mflodman@webrtc.orgc12686c2011-12-21 09:29:28 +000087} // namespace webrtc
88
mflodman@webrtc.orge06ca3c2012-06-29 13:20:14 +000089#endif // WEBRTC_VIDEO_ENGINE_VIE_CODEC_IMPL_H_