From 9a6741d7bfa091ebbebfc5f657dca2e8995f814a Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Wed, 28 Aug 2013 08:10:47 -0700 Subject: [PATCH] video media_type now have their own config_spec.ini --- mediagoblin/config_spec.ini | 21 ------------------ mediagoblin/media_types/video/config_spec.ini | 22 +++++++++++++++++++ mediagoblin/media_types/video/processing.py | 2 +- mediagoblin/media_types/video/util.py | 2 +- .../mediagoblin/media_displays/video.html | 2 +- 5 files changed, 25 insertions(+), 24 deletions(-) create mode 100644 mediagoblin/media_types/video/config_spec.ini diff --git a/mediagoblin/config_spec.ini b/mediagoblin/config_spec.ini index 790c31a5..eb00b07c 100644 --- a/mediagoblin/config_spec.ini +++ b/mediagoblin/config_spec.ini @@ -104,27 +104,6 @@ max_height = integer(default=640) max_width = integer(default=180) max_height = integer(default=180) -[media_type:mediagoblin.media_types.video] -# Should we keep the original file? -keep_original = boolean(default=False) - -# 0 means autodetect, autodetect means number_of_CPUs - 1 -vp8_threads = integer(default=0) -# Range: 0..10 -vp8_quality = integer(default=8) -# Range: -0.1..1 -vorbis_quality = float(default=0.3) - -# Autoplay the video when page is loaded? -auto_play = boolean(default=False) - -[[skip_transcode]] -mime_types = string_list(default=list("video/webm")) -container_formats = string_list(default=list("Matroska")) -video_codecs = string_list(default=list("VP8 video")) -audio_codecs = string_list(default=list("Vorbis")) -dimensions_match = boolean(default=True) - [media_type:mediagoblin.media_types.audio] keep_original = boolean(default=True) # vorbisenc quality diff --git a/mediagoblin/media_types/video/config_spec.ini b/mediagoblin/media_types/video/config_spec.ini new file mode 100644 index 00000000..98714f56 --- /dev/null +++ b/mediagoblin/media_types/video/config_spec.ini @@ -0,0 +1,22 @@ +[plugin_spec] +# Should we keep the original file? +keep_original = boolean(default=False) + +# 0 means autodetect, autodetect means number_of_CPUs - 1 +vp8_threads = integer(default=0) +# Range: 0..10 +vp8_quality = integer(default=8) +# Range: -0.1..1 +vorbis_quality = float(default=0.3) + +# Autoplay the video when page is loaded? +auto_play = boolean(default=False) + +[[skip_transcode]] +mime_types = string_list(default=list("video/webm")) +container_formats = string_list(default=list("Matroska")) +video_codecs = string_list(default=list("VP8 video")) +audio_codecs = string_list(default=list("Vorbis")) +dimensions_match = boolean(default=True) + + diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py index 506c7501..4d1d5ea2 100644 --- a/mediagoblin/media_types/video/processing.py +++ b/mediagoblin/media_types/video/processing.py @@ -126,7 +126,7 @@ class CommonVideoProcessor(MediaProcessor): def common_setup(self): self.video_config = mgg \ - .global_config['media_type:mediagoblin.media_types.video'] + .global_config['plugins'][MEDIA_TYPE] # Pull down and set up the processing file self.process_filename = get_process_filename( diff --git a/mediagoblin/media_types/video/util.py b/mediagoblin/media_types/video/util.py index c33cce5a..beb10129 100644 --- a/mediagoblin/media_types/video/util.py +++ b/mediagoblin/media_types/video/util.py @@ -27,7 +27,7 @@ def skip_transcode(metadata, size): Returns True if the video matches the requirements in the configuration. ''' - config = mgg.global_config['media_type:mediagoblin.media_types.video']\ + config = mgg.global_config['plugins']['mediagoblin.media_types.video']\ ['skip_transcode'] medium_config = mgg.global_config['media:medium'] diff --git a/mediagoblin/templates/mediagoblin/media_displays/video.html b/mediagoblin/templates/mediagoblin/media_displays/video.html index 5c52f9f0..e35169bf 100644 --- a/mediagoblin/templates/mediagoblin/media_displays/video.html +++ b/mediagoblin/templates/mediagoblin/media_displays/video.html @@ -30,7 +30,7 @@ {% set display_type, display_path = media.get_display_media() %}