Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / media / base / android / video_decoder_job.h
blobe981ab8eac7ec0a71a60072cafa72081537e2e6f
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_
8 #include <jni.h>
10 #include "media/base/android/media_decoder_job.h"
12 namespace media {
14 class VideoCodecBridge;
16 // Class for managing video decoding jobs.
17 class VideoDecoderJob : public MediaDecoderJob {
18 public:
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
27 // video data.
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,
32 bool is_secure,
33 const gfx::Size& size,
34 jobject surface,
35 jobject media_crypto,
36 const base::Closure& request_data_cb,
37 const base::Closure& request_resources_cb,
38 const base::Closure& release_resources_cb);
40 private:
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,
49 size_t size,
50 bool render_output,
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_;
61 } // namespace media
63 #endif // MEDIA_BASE_ANDROID_VIDEO_DECODER_JOB_H_