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. 4 5 #ifndef MEDIA_BASE_ANDROID_VIDEO_DECODER_JOB_H_ 6 #define MEDIA_BASE_ANDROID_VIDEO_DECODER_JOB_H_ 7 8 #include <jni.h> 9 10 #include "media/base/android/media_decoder_job.h" 11 12 namespace media { 13 14 class VideoCodecBridge; 15 16 // Class for managing video decoding jobs. 17 class VideoDecoderJob : public MediaDecoderJob { 18 public: 19 virtual ~VideoDecoderJob(); 20 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 static VideoDecoderJob* Create(const VideoCodec video_codec, 30 bool is_secure, 31 const gfx::Size& size, 32 jobject surface, 33 jobject media_crypto, 34 const base::Closure& request_data_cb); 35 36 private: 37 VideoDecoderJob(scoped_ptr<VideoCodecBridge> video_codec_bridge, 38 const base::Closure& request_data_cb); 39 40 // MediaDecoderJob implementation. 41 virtual void ReleaseOutputBuffer( 42 int output_buffer_index, 43 size_t size, 44 bool render_output, 45 const ReleaseOutputCompletionCallback& callback) OVERRIDE; 46 47 virtual bool ComputeTimeToRender() const OVERRIDE; 48 49 scoped_ptr<VideoCodecBridge> video_codec_bridge_; 50 }; 51 52 } // namespace media 53 54 #endif // MEDIA_BASE_ANDROID_VIDEO_DECODER_JOB_H_ 55