Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: media/cast/video_receiver/codecs/vp8/vp8_decoder.h

Issue 80383006: Cast: Forcing codec initialization on a designated thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_ 5 #ifndef MEDIA_CAST_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_
6 #define MEDIA_CAST_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_ 6 #define MEDIA_CAST_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/threading/non_thread_safe.h" 9 #include "base/threading/non_thread_safe.h"
10 #include "media/cast/cast_config.h" 10 #include "media/cast/cast_config.h"
11 #include "media/cast/cast_environment.h" 11 #include "media/cast/cast_environment.h"
12 #include "media/cast/cast_receiver.h" 12 #include "media/cast/cast_receiver.h"
13 #include "third_party/libvpx/source/libvpx/vpx/vpx_decoder.h" 13 #include "third_party/libvpx/source/libvpx/vpx/vpx_decoder.h"
14 14
15 typedef struct vpx_codec_ctx vpx_dec_ctx_t; 15 typedef struct vpx_codec_ctx vpx_dec_ctx_t;
16 16
17 namespace media { 17 namespace media {
18 namespace cast { 18 namespace cast {
19 19
20 // This class is not thread safe; it's only called from the cast video decoder 20 // This class is not thread safe; it's only called from the cast video decoder
21 // thread. 21 // thread.
22 class Vp8Decoder : public base::NonThreadSafe { 22 class Vp8Decoder : public base::NonThreadSafe {
23 public: 23 public:
24 Vp8Decoder(int number_of_cores, 24 explicit Vp8Decoder(scoped_refptr<CastEnvironment> cast_environment);
25 scoped_refptr<CastEnvironment> cast_environment);
26 ~Vp8Decoder(); 25 ~Vp8Decoder();
27 26
28 // Decode frame - The decoded frame will be passed via the callback. 27 // 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 28 // Will return false in case of error, and then it's up to the caller to
30 // release the memory. 29 // release the memory.
31 // Ownership of the encoded_frame does not pass to the Vp8Decoder. 30 // Ownership of the encoded_frame does not pass to the Vp8Decoder.
32 bool Decode(const EncodedVideoFrame* encoded_frame, 31 bool Decode(const EncodedVideoFrame* encoded_frame,
33 const base::TimeTicks render_time, 32 const base::TimeTicks render_time,
34 const VideoFrameDecodedCallback& frame_decoded_cb); 33 const VideoFrameDecodedCallback& frame_decoded_cb);
35 34
36 private: 35 private:
37 // Initialize the decoder. 36 // Initialize the decoder.
38 void InitDecode(int number_of_cores); 37 void InitDecoder();
39
40 scoped_ptr<vpx_dec_ctx_t> decoder_; 38 scoped_ptr<vpx_dec_ctx_t> decoder_;
41 scoped_refptr<CastEnvironment> cast_environment_; 39 scoped_refptr<CastEnvironment> cast_environment_;
42 }; 40 };
43 41
44 } // namespace cast 42 } // namespace cast
45 } // namespace media 43 } // namespace media
46 44
47 #endif // MEDIA_CAST_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_ 45 #endif // MEDIA_CAST_RTP_RECEVIER_CODECS_VP8_VP8_DECODER_H_
OLDNEW
« no previous file with comments | « media/cast/test/encode_decode_test.cc ('k') | media/cast/video_receiver/codecs/vp8/vp8_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698