OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_CAST_VIDEO_RECEVIER_CODECS_VP8_VP8_DECODER_H_ | |
6 #define MEDIA_CAST_VIDEO_RECEVIER_CODECS_VP8_VP8_DECODER_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/threading/non_thread_safe.h" | |
10 #include "media/cast/cast_config.h" | |
11 #include "media/cast/cast_environment.h" | |
12 #include "media/cast/cast_receiver.h" | |
13 #include "media/cast/video_receiver/software_video_decoder.h" | |
14 #include "third_party/libvpx/source/libvpx/vpx/vpx_decoder.h" | |
15 | |
16 typedef struct vpx_codec_ctx vpx_dec_ctx_t; | |
17 | |
18 // TODO(mikhal): Look into reusing VpxVideoDecoder. | |
19 namespace media { | |
20 namespace cast { | |
21 | |
22 class Vp8Decoder : public SoftwareVideoDecoder { | |
23 public: | |
24 explicit Vp8Decoder(scoped_refptr<CastEnvironment> cast_environment); | |
25 virtual ~Vp8Decoder(); | |
26 | |
27 // SoftwareVideoDecoder implementations. | |
28 virtual bool Decode(const transport::EncodedVideoFrame* encoded_frame, | |
29 const base::TimeTicks render_time, | |
30 const VideoFrameDecodedCallback& frame_decoded_cb) | |
31 OVERRIDE; | |
32 | |
33 private: | |
34 // Initialize the decoder. | |
35 void InitDecoder(); | |
36 scoped_ptr<vpx_dec_ctx_t> decoder_; | |
37 scoped_refptr<CastEnvironment> cast_environment_; | |
38 | |
39 DISALLOW_COPY_AND_ASSIGN(Vp8Decoder); | |
40 }; | |
41 | |
42 } // namespace cast | |
43 } // namespace media | |
44 | |
45 #endif // MEDIA_CAST_VIDEO_RECEVIER_CODECS_VP8_VP8_DECODER_H_ | |
OLD | NEW |