From d47e35b2a2c56ecbfc813433d96082394f98136b Mon Sep 17 00:00:00 2001 From: Heshan Date: Fri, 11 Mar 2011 23:09:50 +0530 Subject: Adding video autoconversion and ported video_ffmpeg database queries to D7 --- includes/conversion.inc | 4 ++-- includes/transcoder.inc | 6 +++--- includes/video_helper.inc | 10 ++++++---- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'includes') diff --git a/includes/conversion.inc b/includes/conversion.inc index 8b1c165..b9be2b4 100644 --- a/includes/conversion.inc +++ b/includes/conversion.inc @@ -89,8 +89,8 @@ class video_conversion { return $this->transcoder->load_completed_job($video); } - public function create_job($video) { - return $this->transcoder->create_job($video); + public function create_job($video, $nid) { + return $this->transcoder->create_job($video, $nid); } public function update_job($video) { diff --git a/includes/transcoder.inc b/includes/transcoder.inc index a57fe91..994ab47 100644 --- a/includes/transcoder.inc +++ b/includes/transcoder.inc @@ -167,8 +167,8 @@ class video_transcoder { return $this->transcoder->get_dimensions($video); } - public function create_job($video) { - return $this->transcoder->create_job($video); + public function create_job($video, $nid) { + return $this->transcoder->create_job($video, $nid); } public function update_job($video) { @@ -201,7 +201,7 @@ class video_transcoder { interface transcoder_interface { - public function create_job($video); + public function create_job($video, $nid); public function update_job($video); diff --git a/includes/video_helper.inc b/includes/video_helper.inc index b41f657..a4f2b65 100644 --- a/includes/video_helper.inc +++ b/includes/video_helper.inc @@ -54,13 +54,15 @@ class video_helper { $video->autobuffering = variable_get('video_autobuffering', TRUE); $video->theora_player = variable_get('video_ogg_player', 'http://theora.org/cortado.jar'); // lets find out if we have transcoded this file and update our paths. - if (isset($field_settings['autoconversion']) && $field_settings['autoconversion'] - && !$variables['item']['bypass_autoconversion']) { + if (isset($field_settings['autoconversion']) && $field_settings['autoconversion']) { // discard all existing file data - $video->files = new stdClass(); module_load_include('inc', 'video', '/includes/conversion'); $conversion = new video_conversion; - $conversion->load_completed_job($video); + if ($conversion->load_job($variables['item']['fid'])) { + // reset the video files object and add converted videos in to it + $video->files = new stdClass(); + $conversion->load_completed_job($video); + } } // Let othere module to load the video files by referance // Lets find out if we have pushed this file to the cdn if enabled. -- cgit v1.2.3