| 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 | |
| 26 | 24 |
| 27 // Decode a video frame. Decoded (raw) frame will be returned in the | 25 // Decode a video frame. Decoded (raw) frame will be returned in the |
| 28 // frame_decoded_callback. | 26 // frame_decoded_callback. |
| 29 void DecodeVideoFrame(const EncodedVideoFrame* encoded_frame, | 27 void DecodeVideoFrame(const EncodedVideoFrame* encoded_frame, |
| 30 const base::TimeTicks render_time, | 28 const base::TimeTicks render_time, |
| 31 const VideoFrameDecodedCallback& frame_decoded_callback, | 29 const VideoFrameDecodedCallback& frame_decoded_callback, |
| 32 base::Closure frame_release_callback); | 30 base::Closure frame_release_callback); |
| 33 | 31 |
| 32 protected: |
| 33 virtual ~VideoDecoder(); |
| 34 |
| 34 private: | 35 private: |
| 36 friend class base::RefCountedThreadSafe<VideoDecoder>; |
| 37 |
| 35 void DecodeFrame(const EncodedVideoFrame* encoded_frame, | 38 void DecodeFrame(const EncodedVideoFrame* encoded_frame, |
| 36 const base::TimeTicks render_time, | 39 const base::TimeTicks render_time, |
| 37 const VideoFrameDecodedCallback& frame_decoded_callback); | 40 const VideoFrameDecodedCallback& frame_decoded_callback); |
| 38 VideoCodec codec_; | 41 VideoCodec codec_; |
| 39 scoped_ptr<Vp8Decoder> vp8_decoder_; | 42 scoped_ptr<Vp8Decoder> vp8_decoder_; |
| 40 scoped_refptr<CastThread> cast_thread_; | 43 scoped_refptr<CastThread> cast_thread_; |
| 41 | 44 |
| 42 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); | 45 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); |
| 43 }; | 46 }; |
| 44 | 47 |
| 45 } // namespace cast | 48 } // namespace cast |
| 46 } // namespace media | 49 } // namespace media |
| 47 | 50 |
| 48 #endif // MEDIA_CAST_VIDEO_RECEIVER_VIDEO_DECODER_H_ | 51 #endif // MEDIA_CAST_VIDEO_RECEIVER_VIDEO_DECODER_H_ |
| OLD | NEW |