niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
stefan@webrtc.org | 439be29 | 2012-02-16 14:45:37 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | |
mflodman@webrtc.org | e06ca3c | 2012-06-29 13:20:14 +0000 | [diff] [blame] | 11 | #ifndef WEBRTC_VIDEO_ENGINE_VIE_CODEC_IMPL_H_ |
| 12 | #define WEBRTC_VIDEO_ENGINE_VIE_CODEC_IMPL_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
pbos@webrtc.org | f5d4cb1 | 2013-05-17 13:44:48 +0000 | [diff] [blame^] | 14 | #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.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 18 | |
mflodman@webrtc.org | c12686c | 2011-12-21 09:29:28 +0000 | [diff] [blame] | 19 | namespace webrtc { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 20 | |
mflodman@webrtc.org | b11424b | 2012-01-25 13:42:03 +0000 | [diff] [blame] | 21 | class ViESharedData; |
| 22 | |
mflodman@webrtc.org | c12686c | 2011-12-21 09:29:28 +0000 | [diff] [blame] | 23 | class ViECodecImpl |
mflodman@webrtc.org | b11424b | 2012-01-25 13:42:03 +0000 | [diff] [blame] | 24 | : public ViECodec, |
mflodman@webrtc.org | c12686c | 2011-12-21 09:29:28 +0000 | [diff] [blame] | 25 | public ViERefCount { |
| 26 | public: |
| 27 | virtual int Release(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 28 | |
mflodman@webrtc.org | c12686c | 2011-12-21 09:29:28 +0000 | [diff] [blame] | 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.org | 4aee6b6 | 2012-12-14 14:02:10 +0000 | [diff] [blame] | 52 | virtual int GetReceiveSideDelay(const int video_channel, |
| 53 | int* delay_ms) const; |
stefan@webrtc.org | 439be29 | 2012-02-16 14:45:37 +0000 | [diff] [blame] | 54 | virtual int GetCodecTargetBitrate(const int video_channel, |
| 55 | unsigned int* bitrate) const; |
mflodman@webrtc.org | c12686c | 2011-12-21 09:29:28 +0000 | [diff] [blame] | 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); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 70 | |
mflodman@webrtc.org | c12686c | 2011-12-21 09:29:28 +0000 | [diff] [blame] | 71 | protected: |
mflodman@webrtc.org | 9ba151b | 2012-06-21 10:02:13 +0000 | [diff] [blame] | 72 | explicit ViECodecImpl(ViESharedData* shared_data); |
mflodman@webrtc.org | c12686c | 2011-12-21 09:29:28 +0000 | [diff] [blame] | 73 | virtual ~ViECodecImpl(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 74 | |
mflodman@webrtc.org | c12686c | 2011-12-21 09:29:28 +0000 | [diff] [blame] | 75 | private: |
| 76 | bool CodecValid(const VideoCodec& video_codec); |
mflodman@webrtc.org | b11424b | 2012-01-25 13:42:03 +0000 | [diff] [blame] | 77 | |
| 78 | ViESharedData* shared_data_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 79 | }; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 80 | |
mflodman@webrtc.org | c12686c | 2011-12-21 09:29:28 +0000 | [diff] [blame] | 81 | } // namespace webrtc |
| 82 | |
mflodman@webrtc.org | e06ca3c | 2012-06-29 13:20:14 +0000 | [diff] [blame] | 83 | #endif // WEBRTC_VIDEO_ENGINE_VIE_CODEC_IMPL_H_ |