- add sources.
[platform/framework/web/crosswalk.git] / src / media / cast / video_receiver / codecs / vp8 / vp8_decoder.h
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_CAST_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_
6 #define MEDIA_CAST_RTP_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 "third_party/libvpx/source/libvpx/vpx/vpx_decoder.h"
12
13 typedef struct vpx_codec_ctx vpx_dec_ctx_t;
14
15 namespace media {
16 namespace cast {
17
18 // This class is not thread safe; it's only called from the cast video decoder
19 // thread.
20 class Vp8Decoder : public base::NonThreadSafe {
21  public:
22   explicit Vp8Decoder(int number_of_cores);
23   ~Vp8Decoder();
24
25   // Decode encoded image (as a part of a video stream).
26   bool Decode(const EncodedVideoFrame& input_image,
27               I420VideoFrame* decoded_frame);
28
29  private:
30   // Initialize the decoder.
31   void InitDecode(int number_of_cores);
32
33   scoped_ptr<vpx_dec_ctx_t> decoder_;
34 };
35
36 }  // namespace cast
37 }  // namespace media
38
39 #endif  // MEDIA_CAST_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_