| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "media/cast/cast_environment.h" | 13 #include "media/cast/cast_environment.h" |
| 14 #include "media/cast/cast_receiver.h" | 14 #include "media/cast/cast_receiver.h" |
| 15 #include "media/cast/common/rtp_time.h" |
| 15 #include "media/cast/net/pacing/paced_sender.h" | 16 #include "media/cast/net/pacing/paced_sender.h" |
| 16 #include "media/cast/receiver/frame_receiver.h" | 17 #include "media/cast/receiver/frame_receiver.h" |
| 17 | 18 |
| 18 namespace media { | 19 namespace media { |
| 19 namespace cast { | 20 namespace cast { |
| 20 | 21 |
| 21 class AudioDecoder; | 22 class AudioDecoder; |
| 22 class VideoDecoder; | 23 class VideoDecoder; |
| 23 | 24 |
| 24 // This is a pure owner class that groups all required receiver-related objects | 25 // This is a pure owner class that groups all required receiver-related objects |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 60 |
| 60 // Receives an AudioBus from |audio_decoder_|, logs the event, and passes the | 61 // Receives an AudioBus from |audio_decoder_|, logs the event, and passes the |
| 61 // data on by running the given |callback|. This method is static to ensure | 62 // data on by running the given |callback|. This method is static to ensure |
| 62 // it can be called after a CastReceiverImpl instance is destroyed. | 63 // it can be called after a CastReceiverImpl instance is destroyed. |
| 63 // DecodeEncodedAudioFrame() uses this as a callback for | 64 // DecodeEncodedAudioFrame() uses this as a callback for |
| 64 // AudioDecoder::DecodeFrame(). | 65 // AudioDecoder::DecodeFrame(). |
| 65 static void EmitDecodedAudioFrame( | 66 static void EmitDecodedAudioFrame( |
| 66 const scoped_refptr<CastEnvironment>& cast_environment, | 67 const scoped_refptr<CastEnvironment>& cast_environment, |
| 67 const AudioFrameDecodedCallback& callback, | 68 const AudioFrameDecodedCallback& callback, |
| 68 uint32_t frame_id, | 69 uint32_t frame_id, |
| 69 uint32_t rtp_timestamp, | 70 RtpTimeTicks rtp_timestamp, |
| 70 const base::TimeTicks& playout_time, | 71 const base::TimeTicks& playout_time, |
| 71 scoped_ptr<AudioBus> audio_bus, | 72 scoped_ptr<AudioBus> audio_bus, |
| 72 bool is_continuous); | 73 bool is_continuous); |
| 73 | 74 |
| 74 // Receives a VideoFrame from |video_decoder_|, logs the event, and passes the | 75 // Receives a VideoFrame from |video_decoder_|, logs the event, and passes the |
| 75 // data on by running the given |callback|. This method is static to ensure | 76 // data on by running the given |callback|. This method is static to ensure |
| 76 // it can be called after a CastReceiverImpl instance is destroyed. | 77 // it can be called after a CastReceiverImpl instance is destroyed. |
| 77 // DecodeEncodedVideoFrame() uses this as a callback for | 78 // DecodeEncodedVideoFrame() uses this as a callback for |
| 78 // VideoDecoder::DecodeFrame(). | 79 // VideoDecoder::DecodeFrame(). |
| 79 static void EmitDecodedVideoFrame( | 80 static void EmitDecodedVideoFrame( |
| 80 const scoped_refptr<CastEnvironment>& cast_environment, | 81 const scoped_refptr<CastEnvironment>& cast_environment, |
| 81 const VideoFrameDecodedCallback& callback, | 82 const VideoFrameDecodedCallback& callback, |
| 82 uint32_t frame_id, | 83 uint32_t frame_id, |
| 83 uint32_t rtp_timestamp, | 84 RtpTimeTicks rtp_timestamp, |
| 84 const base::TimeTicks& playout_time, | 85 const base::TimeTicks& playout_time, |
| 85 const scoped_refptr<VideoFrame>& video_frame, | 86 const scoped_refptr<VideoFrame>& video_frame, |
| 86 bool is_continuous); | 87 bool is_continuous); |
| 87 | 88 |
| 88 const scoped_refptr<CastEnvironment> cast_environment_; | 89 const scoped_refptr<CastEnvironment> cast_environment_; |
| 89 FrameReceiver audio_receiver_; | 90 FrameReceiver audio_receiver_; |
| 90 FrameReceiver video_receiver_; | 91 FrameReceiver video_receiver_; |
| 91 | 92 |
| 92 // Used by DispatchReceivedPacket() to direct packets to the appropriate frame | 93 // Used by DispatchReceivedPacket() to direct packets to the appropriate frame |
| 93 // receiver. | 94 // receiver. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 110 // images for playback. | 111 // images for playback. |
| 111 scoped_ptr<VideoDecoder> video_decoder_; | 112 scoped_ptr<VideoDecoder> video_decoder_; |
| 112 | 113 |
| 113 DISALLOW_COPY_AND_ASSIGN(CastReceiverImpl); | 114 DISALLOW_COPY_AND_ASSIGN(CastReceiverImpl); |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 } // namespace cast | 117 } // namespace cast |
| 117 } // namespace media | 118 } // namespace media |
| 118 | 119 |
| 119 #endif // MEDIA_CAST_RECEIVER_CAST_RECEIVER_IMPL_ | 120 #endif // MEDIA_CAST_RECEIVER_CAST_RECEIVER_IMPL_ |
| OLD | NEW |