Add main_task, complimentary_task and cleanup
authorvijeth-aradhya <vijthaaa@gmail.com>
Wed, 7 Jun 2017 15:12:42 +0000 (20:42 +0530)
committervijeth-aradhya <vijthaaa@gmail.com>
Thu, 8 Jun 2017 18:57:01 +0000 (00:27 +0530)
mediagoblin/media_types/video/processing.py

index a7e2d20c599f9919d8bea460298ec8863013e6ef..4dee8d555fb5c279a5ba9e3ae6b389ae3068e0fc 100644 (file)
@@ -160,6 +160,31 @@ def store_metadata(media_entry, metadata):
     if len(stored_metadata):
         media_entry.media_data_init(orig_metadata=stored_metadata)
 
+# =====================
+
+
+def main_task(**process_info):
+    processor = CommonVideoProcessor(process_info['manager'], process_info['entry'])
+    processor.common_setup(process_info['resolution'])
+    processor.transcode(medium_size=process_info['medium_size'], vp8_quality=process_info['vp8_quality'],
+                        vp8_threads=process_info['vp8_threads'], vorbis_quality=process_info['vorbis_quality'])
+    processor.generate_thumb(thumb_size=process_info['thumb_size'])
+    processor.store_orig_metadata()
+
+
+def complimentary_task(**process_info):
+    processor = CommonVideoProcessor(process_info['manager'], process_info['entry'])
+    processor.common_setup(process_info['resolution'])
+    processor.transcode(medium_size=process_info['medium_size'], vp8_quality=process_info['vp8_quality'],
+                        vp8_threads=process_info['vp8_threads'], vorbis_quality=process_info['vorbis_quality'])
+
+
+def processing_cleanup(**process_info):
+    processor = CommonVideoProcessor(process_info['manager'], process_info['entry'])
+    processor.delete_queue_file()
+
+# =====================
+
 
 class CommonVideoProcessor(MediaProcessor):
     """