Remove Unused AsTextButtonBorder RTTI helper.
[chromium-blink-merge.git] / media / cast / video_receiver / codecs / vp8 / vp8_decoder.h
blobef53a7ea83a9ee2cea583a4c08b33a0bbe97dc2f
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 "media/cast/cast_environment.h"
12 #include "media/cast/cast_receiver.h"
13 #include "third_party/libvpx/source/libvpx/vpx/vpx_decoder.h"
15 typedef struct vpx_codec_ctx vpx_dec_ctx_t;
17 // TODO(mikhal): Look into reusing VpxVideoDecoder.
18 namespace media {
19 namespace cast {
21 // This class is not thread safe; it's only called from the cast video decoder
22 // thread.
23 class Vp8Decoder : public base::NonThreadSafe {
24 public:
25 explicit Vp8Decoder(scoped_refptr<CastEnvironment> cast_environment);
26 ~Vp8Decoder();
28 // Decode frame - The decoded frame will be passed via the callback.
29 // Will return false in case of error, and then it's up to the caller to
30 // release the memory.
31 // Ownership of the encoded_frame does not pass to the Vp8Decoder.
32 bool Decode(const transport::EncodedVideoFrame* encoded_frame,
33 const base::TimeTicks render_time,
34 const VideoFrameDecodedCallback& frame_decoded_cb);
36 private:
37 // Initialize the decoder.
38 void InitDecoder();
39 scoped_ptr<vpx_dec_ctx_t> decoder_;
40 scoped_refptr<CastEnvironment> cast_environment_;
42 DISALLOW_COPY_AND_ASSIGN(Vp8Decoder);
45 } // namespace cast
46 } // namespace media
48 #endif // MEDIA_CAST_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_