OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ | 11 #ifndef WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |
12 #define WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ | 12 #define WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |
13 | 13 |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "webrtc/base/scoped_ptr.h" | 16 #include "webrtc/base/scoped_ptr.h" |
17 #include "webrtc/call.h" | 17 #include "webrtc/call.h" |
18 #include "webrtc/call/transport_adapter.h" | 18 #include "webrtc/call/transport_adapter.h" |
19 #include "webrtc/common_video/interface/incoming_video_stream.h" | 19 #include "webrtc/common_video/interface/incoming_video_stream.h" |
20 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 20 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
21 #include "webrtc/modules/video_render/include/video_render_defines.h" | 21 #include "webrtc/modules/video_render/include/video_render_defines.h" |
22 #include "webrtc/system_wrappers/interface/clock.h" | 22 #include "webrtc/system_wrappers/interface/clock.h" |
23 #include "webrtc/video/encoded_frame_callback_adapter.h" | 23 #include "webrtc/video/encoded_frame_callback_adapter.h" |
24 #include "webrtc/video/receive_statistics_proxy.h" | 24 #include "webrtc/video/receive_statistics_proxy.h" |
| 25 #include "webrtc/video_encoder.h" |
25 #include "webrtc/video_engine/vie_channel.h" | 26 #include "webrtc/video_engine/vie_channel.h" |
26 #include "webrtc/video_engine/vie_channel_group.h" | 27 #include "webrtc/video_engine/vie_channel_group.h" |
27 #include "webrtc/video_engine/vie_encoder.h" | 28 #include "webrtc/video_engine/vie_encoder.h" |
28 #include "webrtc/video_receive_stream.h" | 29 #include "webrtc/video_receive_stream.h" |
29 | 30 |
30 namespace webrtc { | 31 namespace webrtc { |
31 | 32 |
32 class VoiceEngine; | 33 class VoiceEngine; |
33 | 34 |
34 namespace internal { | 35 namespace internal { |
35 | 36 |
36 class VideoReceiveStream : public webrtc::VideoReceiveStream, | 37 class VideoReceiveStream : public webrtc::VideoReceiveStream, |
37 public I420FrameCallback, | 38 public I420FrameCallback, |
38 public VideoRenderCallback { | 39 public VideoRenderCallback, |
| 40 public EncodedImageCallback { |
39 public: | 41 public: |
40 VideoReceiveStream(int num_cpu_cores, | 42 VideoReceiveStream(int num_cpu_cores, |
41 ChannelGroup* channel_group, | 43 ChannelGroup* channel_group, |
42 int channel_id, | 44 int channel_id, |
43 const VideoReceiveStream::Config& config, | 45 const VideoReceiveStream::Config& config, |
44 webrtc::VoiceEngine* voice_engine); | 46 webrtc::VoiceEngine* voice_engine); |
45 ~VideoReceiveStream() override; | 47 ~VideoReceiveStream() override; |
46 | 48 |
47 // webrtc::ReceiveStream implementation. | 49 // webrtc::ReceiveStream implementation. |
48 void Start() override; | 50 void Start() override; |
49 void Stop() override; | 51 void Stop() override; |
50 void SignalNetworkState(NetworkState state) override; | 52 void SignalNetworkState(NetworkState state) override; |
51 bool DeliverRtcp(const uint8_t* packet, size_t length) override; | 53 bool DeliverRtcp(const uint8_t* packet, size_t length) override; |
52 bool DeliverRtp(const uint8_t* packet, | 54 bool DeliverRtp(const uint8_t* packet, |
53 size_t length, | 55 size_t length, |
54 const PacketTime& packet_time) override; | 56 const PacketTime& packet_time) override; |
55 | 57 |
56 // webrtc::VideoReceiveStream implementation. | 58 // webrtc::VideoReceiveStream implementation. |
57 webrtc::VideoReceiveStream::Stats GetStats() const override; | 59 webrtc::VideoReceiveStream::Stats GetStats() const override; |
58 | 60 |
59 // Overrides I420FrameCallback. | 61 // Overrides I420FrameCallback. |
60 void FrameCallback(VideoFrame* video_frame) override; | 62 void FrameCallback(VideoFrame* video_frame) override; |
61 | 63 |
62 // Overrides VideoRenderCallback. | 64 // Overrides VideoRenderCallback. |
63 int RenderFrame(const uint32_t /*stream_id*/, | 65 int RenderFrame(const uint32_t /*stream_id*/, |
64 const VideoFrame& video_frame) override; | 66 const VideoFrame& video_frame) override; |
65 | 67 |
| 68 // Overrides EncodedImageCallback. |
| 69 int32_t Encoded(const EncodedImage& encoded_image, |
| 70 const CodecSpecificInfo* codec_specific_info, |
| 71 const RTPFragmentationHeader* fragmentation) override; |
| 72 |
66 const Config& config() const { return config_; } | 73 const Config& config() const { return config_; } |
67 | 74 |
68 void SetSyncChannel(VoiceEngine* voice_engine, int audio_channel_id); | 75 void SetSyncChannel(VoiceEngine* voice_engine, int audio_channel_id); |
69 | 76 |
70 private: | 77 private: |
71 void SetRtcpMode(newapi::RtcpMode mode); | 78 void SetRtcpMode(newapi::RtcpMode mode); |
72 | 79 |
73 TransportAdapter transport_adapter_; | 80 TransportAdapter transport_adapter_; |
74 EncodedFrameCallbackAdapter encoded_frame_proxy_; | 81 EncodedFrameCallbackAdapter encoded_frame_proxy_; |
75 const VideoReceiveStream::Config config_; | 82 const VideoReceiveStream::Config config_; |
76 Clock* const clock_; | 83 Clock* const clock_; |
77 | 84 |
78 ChannelGroup* const channel_group_; | 85 ChannelGroup* const channel_group_; |
79 const int channel_id_; | 86 const int channel_id_; |
80 | 87 |
81 ViEChannel* vie_channel_; | 88 ViEChannel* vie_channel_; |
82 rtc::scoped_ptr<IncomingVideoStream> incoming_video_stream_; | 89 rtc::scoped_ptr<IncomingVideoStream> incoming_video_stream_; |
83 | 90 |
84 rtc::scoped_ptr<ReceiveStatisticsProxy> stats_proxy_; | 91 rtc::scoped_ptr<ReceiveStatisticsProxy> stats_proxy_; |
85 }; | 92 }; |
86 } // namespace internal | 93 } // namespace internal |
87 } // namespace webrtc | 94 } // namespace webrtc |
88 | 95 |
89 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ | 96 #endif // WEBRTC_VIDEO_VIDEO_RECEIVE_STREAM_H_ |
OLD | NEW |