| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_VIDEO_RECEIVER_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_CAST_VIDEO_RECEIVER_VIDEO_DECODER_H_ |
| 6 #define MEDIA_CAST_VIDEO_RECEIVER_VIDEO_DECODER_H_ | 6 #define MEDIA_CAST_VIDEO_RECEIVER_VIDEO_DECODER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "media/cast/cast_config.h" | 11 #include "media/cast/cast_config.h" |
| 12 #include "media/cast/cast_receiver.h" | 12 #include "media/cast/cast_receiver.h" |
| 13 #include "media/cast/cast_thread.h" | 13 #include "media/cast/cast_thread.h" |
| 14 | 14 |
| 15 namespace media { | 15 namespace media { |
| 16 namespace cast { | 16 namespace cast { |
| 17 | 17 |
| 18 class Vp8Decoder; | 18 class Vp8Decoder; |
| 19 | 19 |
| 20 class VideoDecoder : public base::RefCountedThreadSafe<VideoDecoder>{ | 20 class VideoDecoder : public base::RefCountedThreadSafe<VideoDecoder>{ |
| 21 public: | 21 public: |
| 22 VideoDecoder(scoped_refptr<CastThread> cast_thread, | 22 VideoDecoder(scoped_refptr<CastThread> cast_thread, |
| 23 const VideoReceiverConfig& video_config); | 23 const VideoReceiverConfig& video_config); |
| 24 ~VideoDecoder(); |
| 25 |
| 24 | 26 |
| 25 // Decode a video frame. Decoded (raw) frame will be returned in the | 27 // Decode a video frame. Decoded (raw) frame will be returned in the |
| 26 // frame_decoded_callback. | 28 // frame_decoded_callback. |
| 27 void DecodeVideoFrame(const EncodedVideoFrame* encoded_frame, | 29 void DecodeVideoFrame(const EncodedVideoFrame* encoded_frame, |
| 28 const base::TimeTicks render_time, | 30 const base::TimeTicks render_time, |
| 29 const VideoFrameDecodedCallback& frame_decoded_callback, | 31 const VideoFrameDecodedCallback& frame_decoded_callback, |
| 30 base::Closure frame_release_callback); | 32 base::Closure frame_release_callback); |
| 31 | 33 |
| 32 protected: | |
| 33 virtual ~VideoDecoder(); | |
| 34 | |
| 35 private: | 34 private: |
| 36 friend class base::RefCountedThreadSafe<VideoDecoder>; | |
| 37 | |
| 38 void DecodeFrame(const EncodedVideoFrame* encoded_frame, | 35 void DecodeFrame(const EncodedVideoFrame* encoded_frame, |
| 39 const base::TimeTicks render_time, | 36 const base::TimeTicks render_time, |
| 40 const VideoFrameDecodedCallback& frame_decoded_callback); | 37 const VideoFrameDecodedCallback& frame_decoded_callback); |
| 41 VideoCodec codec_; | 38 VideoCodec codec_; |
| 42 scoped_ptr<Vp8Decoder> vp8_decoder_; | 39 scoped_ptr<Vp8Decoder> vp8_decoder_; |
| 43 scoped_refptr<CastThread> cast_thread_; | 40 scoped_refptr<CastThread> cast_thread_; |
| 44 | 41 |
| 45 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); | 42 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); |
| 46 }; | 43 }; |
| 47 | 44 |
| 48 } // namespace cast | 45 } // namespace cast |
| 49 } // namespace media | 46 } // namespace media |
| 50 | 47 |
| 51 #endif // MEDIA_CAST_VIDEO_RECEIVER_VIDEO_DECODER_H_ | 48 #endif // MEDIA_CAST_VIDEO_RECEIVER_VIDEO_DECODER_H_ |
| OLD | NEW |