blob: cee3ed2b2de56bbe779a3e8a5461a0f53318894a [file] [log] [blame]
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +00001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
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
11#ifndef WEBRTC_VIDEO_ENGINE_VIE_CODEC_IMPL_H_
12#define WEBRTC_VIDEO_ENGINE_VIE_CODEC_IMPL_H_
13
pbos@webrtc.org281cff82013-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"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000018
19namespace webrtc {
20
21class ViESharedData;
22
23class ViECodecImpl
24 : public ViECodec,
25 public ViERefCount {
26 public:
27 virtual int Release();
28
29 // 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.orgf314c802012-12-14 14:02:10 +000052 virtual int GetReceiveSideDelay(const int video_channel,
53 int* delay_ms) const;
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000054 virtual int GetCodecTargetBitrate(const int video_channel,
55 unsigned int* bitrate) const;
56 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.org0291c802013-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.org45901772013-11-18 12:18:43 +000073 virtual void SuspendBelowMinBitrate(int video_channel);
stefan@webrtc.orgee234be2013-12-05 14:05:07 +000074 virtual bool GetSendSideDelay(int video_channel, int* avg_delay_ms,
75 int* max_delay_ms) const;
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000076
77 protected:
78 explicit ViECodecImpl(ViESharedData* shared_data);
79 virtual ~ViECodecImpl();
80
81 private:
82 bool CodecValid(const VideoCodec& video_codec);
83
84 ViESharedData* shared_data_;
85};
86
87} // namespace webrtc
88
89#endif // WEBRTC_VIDEO_ENGINE_VIE_CODEC_IMPL_H_