OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_CAST_RECEIVER_CAST_RECEIVER_IMPL_H_ | 5 #ifndef MEDIA_CAST_RECEIVER_CAST_RECEIVER_IMPL_H_ |
6 #define MEDIA_CAST_RECEIVER_CAST_RECEIVER_IMPL_H_ | 6 #define MEDIA_CAST_RECEIVER_CAST_RECEIVER_IMPL_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "media/cast/cast_environment.h" | 10 #include "media/cast/cast_environment.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 scoped_ptr<EncodedFrame> encoded_frame); | 55 scoped_ptr<EncodedFrame> encoded_frame); |
56 | 56 |
57 // Receives an AudioBus from |audio_decoder_|, logs the event, and passes the | 57 // Receives an AudioBus from |audio_decoder_|, logs the event, and passes the |
58 // data on by running the given |callback|. This method is static to ensure | 58 // data on by running the given |callback|. This method is static to ensure |
59 // it can be called after a CastReceiverImpl instance is destroyed. | 59 // it can be called after a CastReceiverImpl instance is destroyed. |
60 // DecodeEncodedAudioFrame() uses this as a callback for | 60 // DecodeEncodedAudioFrame() uses this as a callback for |
61 // AudioDecoder::DecodeFrame(). | 61 // AudioDecoder::DecodeFrame(). |
62 static void EmitDecodedAudioFrame( | 62 static void EmitDecodedAudioFrame( |
63 const scoped_refptr<CastEnvironment>& cast_environment, | 63 const scoped_refptr<CastEnvironment>& cast_environment, |
64 const AudioFrameDecodedCallback& callback, | 64 const AudioFrameDecodedCallback& callback, |
65 uint32 frame_id, | 65 uint32_t frame_id, |
66 uint32 rtp_timestamp, | 66 uint32_t rtp_timestamp, |
67 const base::TimeTicks& playout_time, | 67 const base::TimeTicks& playout_time, |
68 scoped_ptr<AudioBus> audio_bus, | 68 scoped_ptr<AudioBus> audio_bus, |
69 bool is_continuous); | 69 bool is_continuous); |
70 | 70 |
71 // Receives a VideoFrame from |video_decoder_|, logs the event, and passes the | 71 // Receives a VideoFrame from |video_decoder_|, logs the event, and passes the |
72 // data on by running the given |callback|. This method is static to ensure | 72 // data on by running the given |callback|. This method is static to ensure |
73 // it can be called after a CastReceiverImpl instance is destroyed. | 73 // it can be called after a CastReceiverImpl instance is destroyed. |
74 // DecodeEncodedVideoFrame() uses this as a callback for | 74 // DecodeEncodedVideoFrame() uses this as a callback for |
75 // VideoDecoder::DecodeFrame(). | 75 // VideoDecoder::DecodeFrame(). |
76 static void EmitDecodedVideoFrame( | 76 static void EmitDecodedVideoFrame( |
77 const scoped_refptr<CastEnvironment>& cast_environment, | 77 const scoped_refptr<CastEnvironment>& cast_environment, |
78 const VideoFrameDecodedCallback& callback, | 78 const VideoFrameDecodedCallback& callback, |
79 uint32 frame_id, | 79 uint32_t frame_id, |
80 uint32 rtp_timestamp, | 80 uint32_t rtp_timestamp, |
81 const base::TimeTicks& playout_time, | 81 const base::TimeTicks& playout_time, |
82 const scoped_refptr<VideoFrame>& video_frame, | 82 const scoped_refptr<VideoFrame>& video_frame, |
83 bool is_continuous); | 83 bool is_continuous); |
84 | 84 |
85 const scoped_refptr<CastEnvironment> cast_environment_; | 85 const scoped_refptr<CastEnvironment> cast_environment_; |
86 FrameReceiver audio_receiver_; | 86 FrameReceiver audio_receiver_; |
87 FrameReceiver video_receiver_; | 87 FrameReceiver video_receiver_; |
88 | 88 |
89 // Used by DispatchReceivedPacket() to direct packets to the appropriate frame | 89 // Used by DispatchReceivedPacket() to direct packets to the appropriate frame |
90 // receiver. | 90 // receiver. |
91 const uint32 ssrc_of_audio_sender_; | 91 const uint32_t ssrc_of_audio_sender_; |
92 const uint32 ssrc_of_video_sender_; | 92 const uint32_t ssrc_of_video_sender_; |
93 | 93 |
94 // Parameters for the decoders that are created on-demand. The values here | 94 // Parameters for the decoders that are created on-demand. The values here |
95 // might be nonsense if the client of CastReceiverImpl never intends to use | 95 // might be nonsense if the client of CastReceiverImpl never intends to use |
96 // the internal software-based decoders. | 96 // the internal software-based decoders. |
97 const int num_audio_channels_; | 97 const int num_audio_channels_; |
98 const int audio_sampling_rate_; | 98 const int audio_sampling_rate_; |
99 const Codec audio_codec_; | 99 const Codec audio_codec_; |
100 const Codec video_codec_; | 100 const Codec video_codec_; |
101 | 101 |
102 // Created on-demand to decode frames from |audio_receiver_| into AudioBuses | 102 // Created on-demand to decode frames from |audio_receiver_| into AudioBuses |
103 // for playback. | 103 // for playback. |
104 scoped_ptr<AudioDecoder> audio_decoder_; | 104 scoped_ptr<AudioDecoder> audio_decoder_; |
105 | 105 |
106 // Created on-demand to decode frames from |video_receiver_| into VideoFrame | 106 // Created on-demand to decode frames from |video_receiver_| into VideoFrame |
107 // images for playback. | 107 // images for playback. |
108 scoped_ptr<VideoDecoder> video_decoder_; | 108 scoped_ptr<VideoDecoder> video_decoder_; |
109 | 109 |
110 DISALLOW_COPY_AND_ASSIGN(CastReceiverImpl); | 110 DISALLOW_COPY_AND_ASSIGN(CastReceiverImpl); |
111 }; | 111 }; |
112 | 112 |
113 } // namespace cast | 113 } // namespace cast |
114 } // namespace media | 114 } // namespace media |
115 | 115 |
116 #endif // MEDIA_CAST_RECEIVER_CAST_RECEIVER_IMPL_ | 116 #endif // MEDIA_CAST_RECEIVER_CAST_RECEIVER_IMPL_ |
OLD | NEW |