From 8cd94d3aabb438fc8efa275c1b57e44d33e2fac5 Mon Sep 17 00:00:00 2001 From: Heshan Wanigasooriya Date: Wed, 27 May 2009 01:48:29 +0000 Subject: updating 6--2 dev --- .../video_ffmpeg_helper/video_ffmpeg_helper.info | 4 +- .../video_ffmpeg_helper.install | 43 ++++++++++++++------ .../video_ffmpeg_helper/video_ffmpeg_helper.module | 5 +-- plugins/video_ffmpeg_helper/video_render.php | 2 +- plugins/video_ffmpeg_helper/video_scheduler.php | 2 +- plugins/video_image/video_image.info | 4 +- plugins/video_image/video_image.module | 46 +++++++++------------- .../video_multidownload/video_multidownload.info | 3 +- .../video_multidownload/video_multidownload.module | 1 + plugins/video_optmetadata/video_optmetadata.info | 4 +- plugins/video_optmetadata/video_optmetadata.module | 2 +- plugins/video_params/video_params.info | 4 +- plugins/video_params/video_params.module | 1 + 13 files changed, 69 insertions(+), 52 deletions(-) (limited to 'plugins') diff --git a/plugins/video_ffmpeg_helper/video_ffmpeg_helper.info b/plugins/video_ffmpeg_helper/video_ffmpeg_helper.info index e5ce7aa..9706e09 100644 --- a/plugins/video_ffmpeg_helper/video_ffmpeg_helper.info +++ b/plugins/video_ffmpeg_helper/video_ffmpeg_helper.info @@ -1,6 +1,8 @@ +;$Id$ name = Video ffmpeg Helper description = Provide apis for ffmpeg. Simplify video nodes creation. dependencies[] = video dependencies[] = video_upload package = "Video" -core = 6.x \ No newline at end of file +core = 6.x + diff --git a/plugins/video_ffmpeg_helper/video_ffmpeg_helper.install b/plugins/video_ffmpeg_helper/video_ffmpeg_helper.install index 36289d5..f4b2ed9 100644 --- a/plugins/video_ffmpeg_helper/video_ffmpeg_helper.install +++ b/plugins/video_ffmpeg_helper/video_ffmpeg_helper.install @@ -1,11 +1,11 @@ - * porting to Drupal 6 - * @author Heshan Wanigasooriya + * @author Heshan Wanigasooriya + * * @todo */ @@ -14,64 +14,83 @@ */ function video_ffmpeg_helper_schema() { $schema['video_rendering'] = array( - 'description' => t('TODO'), + 'description' => t('Store video transcoding queue'), 'fields' => array( 'vid' => array( - 'description' => t('TODO'), + 'description' => t('video id : primary key'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), 'nid' => array( - 'description' => t('TODO'), + 'description' => t('Node id : index of the {node}.nid'), + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'fid' => array( + 'description' => t('FIle id, index to the {files}.fid'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), 'origfile' => array( - 'description' => t('TODO'), + 'description' => t('original file path'), 'type' => 'text', 'not null' => TRUE, 'default' => '', ), 'pid' => array( - 'description' => t('TODO'), + 'description' => t('Pid'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), 'status' => array( - 'description' => t('TODO'), + 'description' => t('status of the transcoding'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), 'started' => array( - 'description' => t('TODO'), + 'description' => t('Started transcodings'), 'type' => 'int', 'not null' => TRUE, 'default' => 0, ), 'completed' => array( - 'description' => t('TODO'), + 'description' => t('Transcoding completed'), 'type' => 'int', 'not null' => TRUE, 'default' => 0, ), ), + 'indexes' => array( + 'fid' => array('fid'), + 'nid' => array('nid'), + ), 'primary key' => array('vid'), ); return $schema; } - +/** + * Implementation of hook_install(). + */ function video_ffmpeg_helper_install() { // Create tables. drupal_install_schema('video_ffmpeg_helper'); } +/** + * Implementation of hook_uninstall(). + */ +function video_ffmpeg_helper_uninstall() { + drupal_uninstall_schema('video_ffmpeg_helper'); +} \ No newline at end of file diff --git a/plugins/video_ffmpeg_helper/video_ffmpeg_helper.module b/plugins/video_ffmpeg_helper/video_ffmpeg_helper.module index 446058d..b22a0f4 100644 --- a/plugins/video_ffmpeg_helper/video_ffmpeg_helper.module +++ b/plugins/video_ffmpeg_helper/video_ffmpeg_helper.module @@ -1,5 +1,5 @@ new_video_upload_file && !$node->new_video_upload_file_fid) { // no new files uploaded. skipping auto resolution process - return null; - } if(variable_get('video_ffmpeg_helper_auto_resolution', false)) { diff --git a/plugins/video_ffmpeg_helper/video_render.php b/plugins/video_ffmpeg_helper/video_render.php index bba9220..83bae31 100644 --- a/plugins/video_ffmpeg_helper/video_render.php +++ b/plugins/video_ffmpeg_helper/video_render.php @@ -1,5 +1,5 @@ - * porting to Drupal 6 - * @author Heshan Wanigasooriya + * @author Heshan Wanigasooriya + * * @todo + * implement the help of the video upload (Implement the internal hook for the help video_upload_v_help()). */ @@ -179,6 +178,7 @@ function video_image_form_alter(&$form, &$form_state, $form_id) { function video_image_nodeapi(&$node, $op, $teaser) { //print_r($op); //exit; + //db_query("INSERT INTO {op} (id, name) VALUES (%d, '%s')", NULL, $op); if($node->type == 'video') { switch ($op) { case 'load': @@ -192,7 +192,7 @@ function video_image_nodeapi(&$node, $op, $teaser) { case 'presave': //exit; - _video_image_submit($node); + _video_image_presave($node); break; case 'view': @@ -273,11 +273,9 @@ function _video_image_prepare(&$node) { } } -function _video_image_submit(&$node) { - //print_r($node); - //exit; - // ############# PREPARE ####################### - // ------------- MOVED ------------------------- +function _video_image_presave(&$node) { + + // ############# PREPARE ####################### if (count($_POST)) { $validators = array( @@ -295,19 +293,7 @@ function _video_image_submit(&$node) { } if ($field_name) { - /* - if($node->iid){ - - // Remove all the existing images. - $result = db_query("SELECT f.fid, f.filepath FROM {image} i INNER JOIN {files} f ON i.fid = f.fid WHERE i.nid = %d", $node->iid); - while ($file = db_fetch_object($result)) { - file_delete(file_create_path($file->filepath)); - db_query("DELETE FROM {files} WHERE fid = %d", $file->fid); - } - //db_query("DELETE FROM {image} WHERE nid = %d", $node->iid); - } - * - */ + $node->tempimage = _video_image_temp_image_store($field_name); $node->new_image = TRUE; //print_r($node); @@ -430,8 +416,11 @@ function _video_image_thumbnail_debug($msg) { } function _video_image_temp_image_store(&$file) { + // Update the node to reflect the actual filename, it may have been changed + $image = new stdClass(); $image->images[IMAGE_ORIGINAL] = $file->filepath; + //using image module $image->images =_image_build_derivatives($image); $image->type = 'image'; $image->uid = 1; @@ -451,11 +440,12 @@ function _video_image_temp_image_store(&$file) { // save the images in the files table foreach ($image->images as $l => $f) { $info = image_get_info($f); - $file->fid = db_last_insert_id('files','fid'); - if($l=="_original"){ + $original_path = $node->images[IMAGE_ORIGINAL]; + if (file_move($file->filepath, _image_filename($original_path, $size))) { + $file->fid = db_last_insert_id('files','fid'); db_query("INSERT INTO {files} (fid, filename, filepath, filemime, filesize) VALUES (%d, '%s', '%s', '%s', '%s')", $fid, "video_image_temp.$l", $f, $info['mime_type'], $info['file_size']); - } + } $image->fids[$l] = $file->fid; } } diff --git a/plugins/video_multidownload/video_multidownload.info b/plugins/video_multidownload/video_multidownload.info index eac3f33..5c87e9c 100644 --- a/plugins/video_multidownload/video_multidownload.info +++ b/plugins/video_multidownload/video_multidownload.info @@ -1,5 +1,6 @@ +;$Id$ name = Video Multidownload description = Enable multiple file download in video module. dependencies[] = video package = "Video" -core = 6.x \ No newline at end of file +core = 6.x diff --git a/plugins/video_multidownload/video_multidownload.module b/plugins/video_multidownload/video_multidownload.module index 1d3a245..682caba 100644 --- a/plugins/video_multidownload/video_multidownload.module +++ b/plugins/video_multidownload/video_multidownload.module @@ -1,4 +1,5 @@