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

Side by Side Diff: media/base/android/video_decoder_job.cc

Issue 74563002: AndroidVideoEncodeAccelerator is born! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
« no previous file with comments | « media/base/android/media_decoder_job.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "media/base/android/video_decoder_job.h" 5 #include "media/base/android/video_decoder_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "media/base/android/media_codec_bridge.h" 10 #include "media/base/android/media_codec_bridge.h"
(...skipping 12 matching lines...) Expand all
23 // http://crbug.com/245750 23 // http://crbug.com/245750
24 base::LazyInstance<VideoDecoderThread>::Leaky 24 base::LazyInstance<VideoDecoderThread>::Leaky
25 g_video_decoder_thread = LAZY_INSTANCE_INITIALIZER; 25 g_video_decoder_thread = LAZY_INSTANCE_INITIALIZER;
26 26
27 VideoDecoderJob* VideoDecoderJob::Create(const VideoCodec video_codec, 27 VideoDecoderJob* VideoDecoderJob::Create(const VideoCodec video_codec,
28 bool is_secure, 28 bool is_secure,
29 const gfx::Size& size, 29 const gfx::Size& size,
30 jobject surface, 30 jobject surface,
31 jobject media_crypto, 31 jobject media_crypto,
32 const base::Closure& request_data_cb) { 32 const base::Closure& request_data_cb) {
33 scoped_ptr<VideoCodecBridge> codec( 33 scoped_ptr<VideoCodecBridge> codec(VideoCodecBridge::CreateDecoder(
34 VideoCodecBridge::Create(video_codec, is_secure)); 34 video_codec, is_secure, size, surface, media_crypto));
35 if (codec && codec->Start(video_codec, size, surface, media_crypto)) 35 if (codec)
36 return new VideoDecoderJob(codec.Pass(), request_data_cb); 36 return new VideoDecoderJob(codec.Pass(), request_data_cb);
37 37
38 LOG(ERROR) << "Failed to create VideoDecoderJob."; 38 LOG(ERROR) << "Failed to create VideoDecoderJob.";
39 return NULL; 39 return NULL;
40 } 40 }
41 41
42 VideoDecoderJob::VideoDecoderJob( 42 VideoDecoderJob::VideoDecoderJob(
43 scoped_ptr<VideoCodecBridge> video_codec_bridge, 43 scoped_ptr<VideoCodecBridge> video_codec_bridge,
44 const base::Closure& request_data_cb) 44 const base::Closure& request_data_cb)
45 : MediaDecoderJob(g_video_decoder_thread.Pointer()->message_loop_proxy(), 45 : MediaDecoderJob(g_video_decoder_thread.Pointer()->message_loop_proxy(),
(...skipping 11 matching lines...) Expand all
57 const ReleaseOutputCompletionCallback& callback) { 57 const ReleaseOutputCompletionCallback& callback) {
58 video_codec_bridge_->ReleaseOutputBuffer(output_buffer_index, render_output); 58 video_codec_bridge_->ReleaseOutputBuffer(output_buffer_index, render_output);
59 callback.Run(0u); 59 callback.Run(0u);
60 } 60 }
61 61
62 bool VideoDecoderJob::ComputeTimeToRender() const { 62 bool VideoDecoderJob::ComputeTimeToRender() const {
63 return true; 63 return true;
64 } 64 }
65 65
66 } // namespace media 66 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_decoder_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698