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.
5 #ifndef MEDIA_CAST_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_
6 #define MEDIA_CAST_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_
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"
13 typedef struct vpx_codec_ctx vpx_dec_ctx_t;
18 // This class is not thread safe; it's only called from the cast video decoder
20 class Vp8Decoder : public base::NonThreadSafe {
22 explicit Vp8Decoder(int number_of_cores);
25 // Decode encoded image (as a part of a video stream).
26 bool Decode(const EncodedVideoFrame& input_image,
27 I420VideoFrame* decoded_frame);
30 // Initialize the decoder.
31 void InitDecode(int number_of_cores);
33 scoped_ptr<vpx_dec_ctx_t> decoder_;
39 #endif // MEDIA_CAST_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_