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_BASE_ANDROID_VIDEO_DECODER_JOB_H_
6 #define MEDIA_BASE_ANDROID_VIDEO_DECODER_JOB_H_
10 #include "media/base/android/media_decoder_job.h"
14 class VideoCodecBridge
;
16 // Class for managing video decoding jobs.
17 class VideoDecoderJob
: public MediaDecoderJob
{
19 virtual ~VideoDecoderJob();
21 // Create a new VideoDecoderJob instance.
22 // |video_codec| - The video format the object needs to decode.
23 // |is_secure| - Whether secure decoding is required.
24 // |size| - The natural size of the output frames.
25 // |surface| - The surface to render the frames to.
26 // |media_crypto| - Handle to a Java object responsible for decrypting the
28 // |request_data_cb| - Callback used to request more data for the decoder.
29 // |request_resources_cb| - Callback used to request resources.
30 // |release_resources_cb| - Callback used to release resources.
31 static VideoDecoderJob
* Create(const VideoCodec video_codec
,
33 const gfx::Size
& size
,
36 const base::Closure
& request_data_cb
,
37 const base::Closure
& request_resources_cb
,
38 const base::Closure
& release_resources_cb
);
41 VideoDecoderJob(scoped_ptr
<VideoCodecBridge
> video_codec_bridge
,
42 const base::Closure
& request_data_cb
,
43 const base::Closure
& request_resources_cb
,
44 const base::Closure
& release_resources_cb
);
46 // MediaDecoderJob implementation.
47 virtual void ReleaseOutputBuffer(
48 int output_buffer_index
,
51 base::TimeDelta current_presentation_timestamp
,
52 const ReleaseOutputCompletionCallback
& callback
) OVERRIDE
;
54 virtual bool ComputeTimeToRender() const OVERRIDE
;
56 scoped_ptr
<VideoCodecBridge
> video_codec_bridge_
;
58 base::Closure release_resources_cb_
;
63 #endif // MEDIA_BASE_ANDROID_VIDEO_DECODER_JOB_H_