Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1
gnac
gnac-gstreamer-1.0.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gnac-gstreamer-1.0.patch of Package gnac
From 8b96a1df48dde568bb74b5fb5a0ce9b6653fce9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= <ballogyor@gmail.com> Date: Sat, 10 Jan 2015 02:14:35 +0100 Subject: [PATCH] Port to GStreamer 1.0 --- configure.ac | 20 +- data/profiles/aac.xml.in | 27 +- data/profiles/base.xml.in | 2 +- data/profiles/default/CD_Quality,_AAC.xml.in | 4 +- data/profiles/default/CD_Quality,_Lossless.xml.in | 2 +- data/profiles/default/CD_Quality,_Lossy.xml.in | 2 +- data/profiles/default/CD_Quality,_MP3.xml.in | 14 +- data/profiles/default/Voice,_Lossless.xml.in | 2 +- data/profiles/default/Voice,_Lossy.xml.in | 2 +- data/profiles/mp3-lame.xml.in | 110 +------ data/profiles/ui/gnac-profiles-aac.xml | 90 +----- data/profiles/ui/gnac-profiles-lame.xml | 260 +---------------- libgnac/libgnac-converter.c | 4 +- libgnac/libgnac-error.c | 2 +- libgnac/libgnac-gst.c | 4 +- libgnac/libgnac-metadata.c | 16 +- src/Makefile.am | 2 + src/gnac-options.c | 1 + src/profiles/formats/gnac-profiles-aac.c | 35 +-- src/profiles/formats/gnac-profiles-lame.c | 331 +++------------------- src/profiles/formats/gnac-profiles-lame.h | 4 +- src/profiles/formats/gnac-profiles-unknown.c | 2 +- src/profiles/gnac-profiles-default.c | 1 + 23 files changed, 119 insertions(+), 818 deletions(-) diff --git a/configure.ac b/configure.ac index b2c5605..ee9005f 100644 --- a/configure.ac +++ b/configure.ac @@ -93,21 +93,21 @@ AC_SUBST(UNIQUE_LIBS) dnl Find the GStreamer libraries GSTREAMER_REQUIRED_VERSION=0.10.31 PKG_CHECK_MODULES(GSTREAMER, [ - gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION - gstreamer-base-0.10 >= $GSTREAMER_REQUIRED_VERSION - gstreamer-pbutils-0.10 >= $GSTREAMER_REQUIRED_VERSION - gstreamer-plugins-base-0.10 >= $GSTREAMER_REQUIRED_VERSION - gstreamer-tag-0.10 >= $GSTREAMER_REQUIRED_VERSION + gstreamer-1.0 >= $GSTREAMER_REQUIRED_VERSION + gstreamer-base-1.0 >= $GSTREAMER_REQUIRED_VERSION + gstreamer-pbutils-1.0 >= $GSTREAMER_REQUIRED_VERSION + gstreamer-plugins-base-1.0 >= $GSTREAMER_REQUIRED_VERSION + gstreamer-tag-1.0 >= $GSTREAMER_REQUIRED_VERSION ]) AC_SUBST(GSTREAMER_CFLAGS) AC_SUBST(GSTREAMER_LIBS) dnl Find the GStreamer elements we use, and warn if they are not present -AM_GST_ELEMENT_CHECK(faac, , AC_MSG_WARN([The 'faac' element was not found. This will cause encoding to AAC to fail.])) -AM_GST_ELEMENT_CHECK(flacenc, , AC_MSG_WARN([The 'flacenc' element was not found. This will cause encoding to FLAC to fail.])) -AM_GST_ELEMENT_CHECK(lame, , AC_MSG_WARN([The 'lame' element was not found. This will cause encoding to MP3 to fail.])) -AM_GST_ELEMENT_CHECK(wavenc, , AC_MSG_WARN([The 'wavenc' element was not found. This will cause encoding to WAV to fail.])) -AM_GST_ELEMENT_CHECK(wavpackenc, , AC_MSG_WARN([The 'wavpackenc' element was not found. This will cause encoding to WAVPACK to fail.])) +GST_ELEMENT_CHECK(faac, 1.0, , AC_MSG_WARN([The 'faac' element was not found. This will cause encoding to AAC to fail.])) +GST_ELEMENT_CHECK(flacenc, 1.0, , AC_MSG_WARN([The 'flacenc' element was not found. This will cause encoding to FLAC to fail.])) +GST_ELEMENT_CHECK(lamemp3enc, 1.0, , AC_MSG_WARN([The 'lamemp3enc' element was not found. This will cause encoding to MP3 to fail.])) +GST_ELEMENT_CHECK(wavenc, 1.0, , AC_MSG_WARN([The 'wavenc' element was not found. This will cause encoding to WAV to fail.])) +GST_ELEMENT_CHECK(wavpackenc, 1.0, , AC_MSG_WARN([The 'wavpackenc' element was not found. This will cause encoding to WAVPACK to fail.])) dnl Optionnaly enable G* deprecations AC_MSG_CHECKING([Wether to enable deprecation warnings]) diff --git a/data/profiles/aac.xml.in b/data/profiles/aac.xml.in index dfc6d3b..45326ef 100644 --- a/data/profiles/aac.xml.in +++ b/data/profiles/aac.xml.in @@ -11,8 +11,8 @@ <pipeline> <process id="gstreamer-audio">faac</process> <process id="multiplexer"> - <value value="ffmux_mp4">...</value> - </process> + <value value="mp4mux">...</value> + </process> <variable id="bitrate" type="combo"> <name>Bitrate</name> <variable-name>bitrate</variable-name> @@ -37,33 +37,12 @@ <value value="320000">320 Kbps</value> </possible-values> </variable> - <variable id="profile" type="combo"> - <name>Profile</name> - <_description>AAC takes a modular approach to encoding. There are four default profiles using different tools: (LC) -> the simplest and most widely used and supported; (MAIN) -> like the LC profile, with the addition of backwards prediction; (SRS) -> a.k.a. Scalable Sample Rate (MPEG-4 AAC-SSR); (LTP) -> an improvement of the MAIN profile using a forward predictor with lower computational complexity.</_description> - <variable-name>profile</variable-name> - <default-value>1</default-value> - <possible-values> - <value value="1">Main (MAIN)</value> - <value value="2">Low complexity (LC)</value> - <value value="3">Scalable sampling rate (SSR)</value> - <value value="4">Long term prediction (LTP)</value> - </possible-values> - </variable> - <variable id="tns" type="check"> + <variable id="tns" type="check"> <name>Temporal noise shaping</name> <_description>Conventional transform coding schemes often encounter problems with signals that vary heavily over time, especially speech signals. Temporal noise shaping can be viewed as a postprocessing step which goal is to overcome this limitation.</_description> <variable-name>tns</variable-name> <default-value>false</default-value> </variable> - <variable id="outputformat" type="combo"> - <name>Output format</name> - <variable-name>outputformat</variable-name> - <default-value>1</default-value> - <possible-values> - <_value value="1">ADTS headers</_value> - <_value value="0">Raw AAC</_value> - </possible-values> - </variable> </pipeline> </profile> </profiles> diff --git a/data/profiles/base.xml.in b/data/profiles/base.xml.in index 70665c3..bbef919 100755 --- a/data/profiles/base.xml.in +++ b/data/profiles/base.xml.in @@ -21,7 +21,7 @@ </variable> </preset-variables> <pipeline> - <process id="gstreamer-audio">audio/x-raw-int</process> + <process id="gstreamer-audio">audio/x-raw</process> <process id="audioconvert">audioconvert</process> </pipeline> </audio-profiles> diff --git a/data/profiles/default/CD_Quality,_AAC.xml.in b/data/profiles/default/CD_Quality,_AAC.xml.in index d13164f..a56cd75 100644 --- a/data/profiles/default/CD_Quality,_AAC.xml.in +++ b/data/profiles/default/CD_Quality,_AAC.xml.in @@ -8,12 +8,10 @@ <_description>Used for converting to CD-quality audio, but with the lossy AAC codec. Use this for preparing files for copying to devices that only support the AAC codec. Note that using this format may be illegal in your jurisdiction; contact your lawyer for advice.</_description> <channels>2</channels> <sample-rate>44100</sample-rate> - <pipeline>audioconvert ! audio/x-raw-float, rate=44100, channels=2 ! audioconvert ! faac bitrate=128000 outputformat=1</pipeline> + <pipeline>audioconvert ! audio/x-raw, rate=44100, channels=2 ! audioconvert ! faac bitrate=128000 ! audio/mpeg, mpegversion=4, stream-format=adts ! aacparse</pipeline> </base> <format-specific> <bitrate>128000</bitrate> - <outputformat>1</outputformat> - <profile>1</profile> <tns>false</tns> </format-specific> </audio-profile> diff --git a/data/profiles/default/CD_Quality,_Lossless.xml.in b/data/profiles/default/CD_Quality,_Lossless.xml.in index a052cc1..dd26c4d 100644 --- a/data/profiles/default/CD_Quality,_Lossless.xml.in +++ b/data/profiles/default/CD_Quality,_Lossless.xml.in @@ -8,7 +8,7 @@ <_description>Used for converting to CD-quality audio, but with a lossless compression codec. Use this if you later want to edit the file or burn it to CD.</_description> <channels>2</channels> <sample-rate>44100</sample-rate> - <pipeline>audioconvert ! audio/x-raw-float, rate=44100, channels=2 ! audioconvert ! flacenc name=enc quality=5</pipeline> + <pipeline>audioconvert ! audio/x-raw, rate=44100, channels=2 ! audioconvert ! flacenc name=enc quality=5</pipeline> </base> <format-specific> <quality>5</quality> diff --git a/data/profiles/default/CD_Quality,_Lossy.xml.in b/data/profiles/default/CD_Quality,_Lossy.xml.in index 2a7c611..52716e0 100644 --- a/data/profiles/default/CD_Quality,_Lossy.xml.in +++ b/data/profiles/default/CD_Quality,_Lossy.xml.in @@ -8,7 +8,7 @@ <_description>Used for converting to CD-quality audio, but with a lossy compression codec. Use this for CD extraction and radio recordings.</_description> <channels>2</channels> <sample-rate>44100</sample-rate> - <pipeline>audioconvert ! audio/x-raw-float, rate=44100, channels=2 ! audioconvert ! vorbisenc name=enc quality=0.5 ! oggmux</pipeline> + <pipeline>audioconvert ! audio/x-raw, rate=44100, channels=2 ! audioconvert ! vorbisenc name=enc quality=0.5 ! oggmux</pipeline> </base> <format-specific> <quality>0.5</quality> diff --git a/data/profiles/default/CD_Quality,_MP3.xml.in b/data/profiles/default/CD_Quality,_MP3.xml.in index d0cc8bd..9b98237 100644 --- a/data/profiles/default/CD_Quality,_MP3.xml.in +++ b/data/profiles/default/CD_Quality,_MP3.xml.in @@ -8,18 +8,12 @@ <_description>Used for converting to CD-quality audio, but with the lossy MP3 codec. Use this for preparing files for copying to devices that only support the MP3 codec. Note that using this format may be illegal in your jurisdiction; contact your lawyer for advice.</_description> <channels>2</channels> <sample-rate>44100</sample-rate> - <pipeline>audioconvert ! audio/x-raw-float, rate=44100, channels=2 ! audioconvert ! lame name=enc mode=4 vbr=4 vbr-quality=6 ! xingmux ! id3v2mux</pipeline> + <pipeline>audioconvert ! audio/x-raw, rate=44100, channels=2 ! audioconvert ! lamemp3enc name=enc target=quality quality=4 ! xingmux ! id3v2mux</pipeline> </base> <format-specific> - <encoding-mode>4</encoding-mode> + <target>quality</target> <bitrate/> - <quality>6</quality> - <compression-ratio/> - <preset/> - <mean-abr/> - <mean-bitrate/> - <min-bitrate/> - <max-bitrate/> - <mode>4</mode> + <quality>4</quality> + <mono/> </format-specific> </audio-profile> diff --git a/data/profiles/default/Voice,_Lossless.xml.in b/data/profiles/default/Voice,_Lossless.xml.in index 18db6fa..ab9f85c 100644 --- a/data/profiles/default/Voice,_Lossless.xml.in +++ b/data/profiles/default/Voice,_Lossless.xml.in @@ -8,7 +8,7 @@ <_description>Used for converting to lossless voice-quality audio. Use this for recording and editing speech.</_description> <channels>2</channels> <sample-rate>44100</sample-rate> - <pipeline>audioconvert ! audio/x-raw-int, rate=44100, channels=2 ! audioconvert ! wavenc name=enc</pipeline> + <pipeline>audioconvert ! audio/x-raw, rate=44100, channels=2 ! audioconvert ! wavenc name=enc</pipeline> </base> <format-specific> </format-specific> diff --git a/data/profiles/default/Voice,_Lossy.xml.in b/data/profiles/default/Voice,_Lossy.xml.in index 97d5f1d..82b14a0 100644 --- a/data/profiles/default/Voice,_Lossy.xml.in +++ b/data/profiles/default/Voice,_Lossy.xml.in @@ -8,7 +8,7 @@ <_description>Used for converting to lossy voice-quality audio. Use this for recording speech that doesn't need to be edited.</_description> <channels>2</channels> <sample-rate>44100</sample-rate> - <pipeline>audioconvert ! audio/x-raw-float, rate=44100, channels=2 ! audioconvert ! speexenc name=enc quality=8 vad=false mode=0 ! oggmux</pipeline> + <pipeline>audioconvert ! audio/x-raw, rate=44100, channels=2 ! audioconvert ! speexenc name=enc quality=8 vad=false mode=0 ! oggmux</pipeline> </base> <format-specific> <bitrate-cbr/> diff --git a/data/profiles/mp3-lame.xml.in b/data/profiles/mp3-lame.xml.in index e4e9d09..39bb94f 100644 --- a/data/profiles/mp3-lame.xml.in +++ b/data/profiles/mp3-lame.xml.in @@ -13,58 +13,27 @@ <mimetype>application/x-id3</mimetype> <mimetype>audio/x-mp3</mimetype> <pipeline> - <process id="gstreamer-audio">lame name=enc</process> + <process id="gstreamer-audio">lamemp3enc name=enc</process> <process id="multiplexer"> <value value="xingmux">Add Xing header</value> <value value="id3v2mux">Add id3v2 header</value> </process> - <variable id="preset" type="combo"> - <name>Preset</name> - <variable-name>preset</variable-name> - <default-value>1006</default-value> - <possible-values> - <_value value="1006">Medium</_value> - <_value value="1001">Standard</_value> - <_value value="1002">Extreme</_value> - <_value value="1003">Insane</_value> - </possible-values> - </variable> - <variable id="encoding-mode" type="combo"> - <name>Bitrate mode</name> - <variable-name>vbr</variable-name> + <variable id="target" type="combo"> + <name>Target</name> + <variable-name>target</variable-name> <default-value>0</default-value> <possible-values> - <_value value="0">Constant bitrate (CBR)</_value> - <_value value="3">Average bitrate (ABR)</_value> - <_value value="4">Variable bitrate (VBR)</_value> - <_value value="5">Presets</_value> - <_value value="6">Compression ratio</_value> + <_value value="quality">Quality</_value> + <_value value="bitrate">Bitrate</_value> </possible-values> </variable> <variable id="quality" type="slider"> <name>VBR quality</name> - <variable-name>vbr-quality</variable-name> + <variable-name>quality</variable-name> <min-value>0.0</min-value> - <max-value>9.0</max-value> + <max-value>10.0</max-value> <step-value>1.0</step-value> - <default-value>3.0</default-value> - </variable> - <variable id="compression-ratio" type="slider"> - <name>Compression ratio</name> - <_description>Let lame choose bitrate to achieve selected compression ratio.</_description> - <variable-name>compression-ratio</variable-name> - <min-value>0.0</min-value> - <max-value>200</max-value> - <step-value>1.0</step-value> - <default-value>0.0</default-value> - </variable> - <variable id="mean-bitrate" type="slider"> - <name>VBR mean bitrate</name> - <variable-name>vbr-mean-bitrate</variable-name> - <min-value>0.0</min-value> - <max-value>330.0</max-value> - <step-value>1.0</step-value> - <default-value>192</default-value> + <default-value>4.0</default-value> </variable> <variable id="bitrate" type="combo"> <name>Bitrate</name> @@ -90,64 +59,13 @@ <value value="320">320 Kbps</value> </possible-values> </variable> - <variable id="min-bitrate" type="combo"> - <name>VBR minimum bitrate</name> - <variable-name>vbr-min-bitrate</variable-name> - <default-value>128</default-value> - <possible-values> - <value value="8">8 Kbps</value> - <value value="16">16 Kbps</value> - <value value="24">24 Kbps</value> - <value value="32">32 Kbps</value> - <value value="40">40 Kbps</value> - <value value="48">48 Kbps</value> - <value value="56">56 Kbps</value> - <value value="64">64 Kbps</value> - <value value="80">80 Kbps</value> - <value value="96">96 Kbps</value> - <value value="112">112 Kbps</value> - <value value="128">128 Kbps</value> - <value value="160">160 Kbps</value> - <value value="192">192 Kbps</value> - <value value="224">224 Kbps</value> - <value value="256">256 Kbps</value> - <value value="320">320 Kbps</value> - </possible-values> - </variable> - <variable id="max-bitrate" type="combo"> - <name>VBR maximum bitrate</name> - <variable-name>vbr-max-bitrate</variable-name> - <default-value>128</default-value> - <possible-values> - <value value="8">8 Kbps</value> - <value value="16">16 Kbps</value> - <value value="24">24 Kbps</value> - <value value="32">32 Kbps</value> - <value value="40">40 Kbps</value> - <value value="48">48 Kbps</value> - <value value="56">56 Kbps</value> - <value value="64">64 Kbps</value> - <value value="80">80 Kbps</value> - <value value="96">96 Kbps</value> - <value value="112">112 Kbps</value> - <value value="128">128 Kbps</value> - <value value="160">160 Kbps</value> - <value value="192">192 Kbps</value> - <value value="224">224 Kbps</value> - <value value="256">256 Kbps</value> - <value value="320">320 Kbps</value> - </possible-values> - </variable> - <variable id="mode" type="combo"> + <variable id="mono" type="combo"> <name>Mode</name> - <variable-name>mode</variable-name> - <default-value>4</default-value> + <variable-name>mono</variable-name> + <default-value>0</default-value> <possible-values> - <_value value="0">Stereo</_value> - <_value value="1">Joint Stereo</_value> - <_value value="2">Dual Channel</_value> - <_value value="3">Mono</_value> - <_value value="4">Auto</_value> + <_value value="0">Auto</_value> + <_value value="1">Mono</_value> </possible-values> </variable> </pipeline> diff --git a/data/profiles/ui/gnac-profiles-aac.xml b/data/profiles/ui/gnac-profiles-aac.xml index 95cc709..3eebf60 100755 --- a/data/profiles/ui/gnac-profiles-aac.xml +++ b/data/profiles/ui/gnac-profiles-aac.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.18.3 --> <interface> - <!-- interface-requires gtk+ 3.0 --> + <requires lib="gtk+" version="3.0"/> <object class="GtkAlignment" id="properties-alignment"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -26,84 +27,6 @@ <property name="row_spacing">5</property> <property name="column_spacing">10</property> <child> - <object class="GtkLabel" id="label-outputformat"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Output format</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox-outputformat"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkComboBoxText" id="combo-outputformat"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <signal name="changed" handler="gnac_profiles_aac_generate_pipeline" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label-profile"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Profile</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox-profile"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkComboBoxText" id="combo-profile"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <signal name="changed" handler="gnac_profiles_aac_generate_pipeline" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> <object class="GtkCheckButton" id="checkbutton-tns"> <property name="label" translatable="yes">Temporal noise shaping</property> <property name="use_action_appearance">False</property> @@ -111,16 +34,14 @@ <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="hexpand">True</property> - <property name="use_action_appearance">False</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> <signal name="toggled" handler="gnac_profiles_aac_generate_pipeline" swapped="no"/> </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="top_attach">1</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -146,7 +67,6 @@ <property name="left_attach">0</property> <property name="top_attach">1</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -170,8 +90,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -184,8 +102,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> diff --git a/data/profiles/ui/gnac-profiles-lame.xml b/data/profiles/ui/gnac-profiles-lame.xml index 8e0f274..2051395 100755 --- a/data/profiles/ui/gnac-profiles-lame.xml +++ b/data/profiles/ui/gnac-profiles-lame.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.18.3 --> <interface> - <!-- interface-requires gtk+ 3.0 --> + <requires lib="gtk+" version="3.0"/> <object class="GtkAdjustment" id="adjustment1"> <property name="upper">100</property> <property name="step_increment">1</property> @@ -10,9 +11,6 @@ <object class="GtkAdjustment" id="adjustment2"> <property name="step_increment">1</property> </object> - <object class="GtkAdjustment" id="adjustment3"> - <property name="step_increment">1</property> - </object> <object class="GtkAlignment" id="properties-alignment"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -44,7 +42,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <child> - <object class="GtkComboBoxText" id="combo-mode"> + <object class="GtkComboBoxText" id="combo-mono"> <property name="visible">True</property> <property name="can_focus">False</property> <signal name="changed" handler="gnac_profiles_lame_generate_pipeline" swapped="no"/> @@ -60,8 +58,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -74,133 +70,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="checkbutton-mean-bitrate"> - <property name="label" translatable="yes">Mean bitrate</property> - <property name="use_action_appearance">False</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_action_appearance">False</property> - <property name="xalign">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="gnac_profiles_lame_advanced_bitrate_on_toggle" object="slider-mean-vbr" swapped="yes"/> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="checkbutton-min-bitrate"> - <property name="label" translatable="yes">Min bitrate</property> - <property name="use_action_appearance">False</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_action_appearance">False</property> - <property name="xalign">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="gnac_profiles_lame_advanced_bitrate_on_toggle" object="combo-min-vbr" swapped="yes"/> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="checkbutton-max-bitrate"> - <property name="label" translatable="yes">Max bitrate</property> - <property name="use_action_appearance">False</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="use_action_appearance">False</property> - <property name="xalign">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="gnac_profiles_lame_advanced_bitrate_on_toggle" object="combo-max-vbr" swapped="yes"/> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">4</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkHScale" id="slider-mean-vbr"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="adjustment">adjustment1</property> - <property name="digits">0</property> - <signal name="value-changed" handler="gnac_profiles_lame_generate_pipeline" swapped="no"/> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox5"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkComboBoxText" id="combo-min-vbr"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">False</property> - <signal name="changed" handler="gnac_profiles_lame_generate_pipeline" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox6"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkComboBoxText" id="combo-max-vbr"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">False</property> - <signal name="changed" handler="gnac_profiles_lame_generate_pipeline" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">4</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -223,9 +92,8 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">6</property> + <property name="top_attach">3</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -233,10 +101,10 @@ <property name="visible">True</property> <property name="can_focus">False</property> <child> - <object class="GtkComboBoxText" id="combo-encoding-mode"> + <object class="GtkComboBoxText" id="combo-target"> <property name="visible">True</property> <property name="can_focus">False</property> - <signal name="changed" handler="gnac_profiles_lame_on_encoding_mode_changed" swapped="no"/> + <signal name="changed" handler="gnac_profiles_lame_on_target_changed" swapped="no"/> </object> <packing> <property name="expand">False</property> @@ -249,8 +117,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -274,47 +140,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox-preset"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkComboBoxText" id="combo-preset"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <signal name="changed" handler="gnac_profiles_lame_generate_pipeline" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label-preset"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Preset</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -327,8 +152,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -336,13 +159,11 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Constant bitrate (CBR)</property> + <property name="label" translatable="yes">Bitrate</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -350,13 +171,11 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Encoding mode</property> + <property name="label" translatable="yes">Target</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -414,69 +233,12 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label-mean-bitrate"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Average bitrate (ABR)</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">4</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkHScale" id="slider-mean-abr"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">adjustment1</property> - <property name="digits">0</property> - <signal name="value-changed" handler="gnac_profiles_lame_generate_pipeline" swapped="no"/> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">4</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label-compression-ratio"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Compression ratio</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">5</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkHScale" id="slider-compression-ratio"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">adjustment3</property> - <property name="digits">0</property> - <signal name="value-changed" handler="gnac_profiles_lame_generate_pipeline" swapped="no"/> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">5</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> </child> </object> + <object class="GtkAdjustment" id="adjustment3"> + <property name="step_increment">1</property> + </object> </interface> diff --git a/libgnac/libgnac-converter.c b/libgnac/libgnac-converter.c index 35d9bc4..2674517 100644 --- a/libgnac/libgnac-converter.c +++ b/libgnac/libgnac-converter.c @@ -1000,13 +1000,13 @@ libgnac_converter_percentage_cb(LibgnacConverter *converter) gint64 pos; static GstFormat format = GST_FORMAT_TIME; - if (gst_element_query_position(item->pipeline, &format, &pos)) { + if (gst_element_query_position(item->pipeline, format, &pos)) { if (pos != item->pos) { gint64 len; gfloat result = 0.0f; guint64 time_left = 0; - if (gst_element_query_duration(item->pipeline, &format, &len)) { + if (gst_element_query_duration(item->pipeline, format, &len)) { gfloat processed = priv->elapsed_duration + ((pos - len) / GST_SECOND); result = CLAMP(processed / priv->total_duration, 0.0f, 1.0f); /* XXX this is a workaround to prevent the remaining time diff --git a/libgnac/libgnac-error.c b/libgnac/libgnac-error.c index 5f4662c..e2f422b 100644 --- a/libgnac/libgnac-error.c +++ b/libgnac/libgnac-error.c @@ -52,7 +52,7 @@ libgnac_error_handle_missing_plugin(LibgnacMediaItem *item, gst_message_unref(msg); if (!detail) return; - gchar *details[] = { detail, NULL }; + const gchar *details[] = { detail, NULL }; GstInstallPluginsReturn ret = gst_install_plugins_async(details, NULL, libgnac_converter_missing_plugin_result_cb, item->parent); g_free(detail); diff --git a/libgnac/libgnac-gst.c b/libgnac/libgnac-gst.c index 8cfa60d..a646826 100644 --- a/libgnac/libgnac-gst.c +++ b/libgnac/libgnac-gst.c @@ -223,7 +223,7 @@ libgnac_gst_build_pipeline(LibgnacMediaItem *item, /* decodebin */ GstElement *decodebin = libgnac_gstu_make_pipeline_element(item->pipeline, - "decodebin2", NULL, &err); + "decodebin", NULL, &err); if (err) { g_propagate_error(error, err); return; @@ -382,7 +382,7 @@ libgnac_gst_newpad_cb(GstElement *decodebin, gpointer data) { LibgnacMediaItem *item = (LibgnacMediaItem *) data; - GstCaps *caps = gst_pad_get_caps(pad); + GstCaps *caps = gst_pad_query_caps(pad, NULL); if (gst_caps_is_empty(caps) || gst_caps_is_any(caps)) { libgnac_debug("Got a bad caps: %s", gst_caps_to_string(caps)); diff --git a/libgnac/libgnac-metadata.c b/libgnac/libgnac-metadata.c index c8f1d39..540586e 100644 --- a/libgnac/libgnac-metadata.c +++ b/libgnac/libgnac-metadata.c @@ -209,11 +209,14 @@ libgnac_metadata_process_tag_image(const GstTagList *taglist, GstBuffer *buffer = gst_value_get_buffer(val); g_return_if_fail(buffer); + GstSample *sample = gst_value_get_sample(val); + g_return_if_fail(sample); + gint image_type = GST_TAG_IMAGE_TYPE_NONE; /* GST_TAG_PREVIEW_IMAGE does not have an "image-type" field */ if (g_str_equal(tag_name, GST_TAG_IMAGE)) { - GstCaps *caps = GST_BUFFER_CAPS(buffer); + GstCaps *caps = gst_sample_get_caps(sample); g_return_if_fail(caps); GstStructure *structure = gst_caps_get_structure(caps, 0); @@ -231,8 +234,11 @@ libgnac_metadata_process_tag_image(const GstTagList *taglist, { GdkPixbufLoader *loader = gdk_pixbuf_loader_new(); GError *error = NULL; - guint8 *data = GST_BUFFER_DATA(buffer); - guint size = GST_BUFFER_SIZE(buffer); + GstMapInfo *info = NULL; + gst_buffer_map(buffer, info, GST_MAP_READ); + guint8 *data = info->data; + guint size = info->size; + gst_buffer_unmap(buffer, info); if (!gdk_pixbuf_loader_write(loader, data, size, &error)) { libgnac_debug("Error writing data to pixbuf: %s", error->message); @@ -297,8 +303,8 @@ libgnac_metadata_process_tag(const GstTagList *taglist, if (g_str_equal(tag_name, GST_TAG_DATE)) { - g_return_if_fail(GST_VALUE_HOLDS_DATE(newval)); - const GDate *date = gst_value_get_date(newval); + g_return_if_fail(G_VALUE_HOLDS(newval,G_TYPE_DATE)); + const GDate *date = g_value_get_boxed(newval); if (!date) return; GDateYear year = g_date_get_year(date); g_value_unset(newval); diff --git a/src/Makefile.am b/src/Makefile.am index fffd4b1..81c9fbc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -73,6 +73,7 @@ gnac_CFLAGS = \ $(AM_CFLAGS) \ $(GSTREAMER_CFLAGS) \ $(GTK_CFLAGS) \ + $(LIBXML_CFLAGS) \ $(NOTIFY_CFLAGS) \ $(UNIQUE_CFLAGS) \ $(WARN_CFLAGS) \ @@ -82,6 +83,7 @@ gnac_LDADD = \ $(top_builddir)/libgnac/libgnac.la \ $(GSTREAMER_LIBS) \ $(GTK_LIBS) \ + $(LIBXML_LIBS) \ $(NOTIFY_LIBS) \ $(UNIQUE_LIBS) diff --git a/src/gnac-options.c b/src/gnac-options.c index 5b537ba..8dbb212 100644 --- a/src/gnac-options.c +++ b/src/gnac-options.c @@ -27,6 +27,7 @@ #include "config.h" #endif +#include <stdlib.h> #include <glib/gi18n.h> #include <gst/gst.h> diff --git a/src/profiles/formats/gnac-profiles-aac.c b/src/profiles/formats/gnac-profiles-aac.c index 653e8ca..9e06257 100755 --- a/src/profiles/formats/gnac-profiles-aac.c +++ b/src/profiles/formats/gnac-profiles-aac.c @@ -34,8 +34,6 @@ typedef struct AudioProfileGeneric *generic; gchar *bitrate; - gchar *outputformat; - gchar *profile; gchar *tns; } AudioProfileAAC; @@ -60,7 +58,6 @@ static const gchar * gnac_profiles_aac_init(void) { GtkWidget *widget; - GtkWidget *widget2; gnac_profiles_default_init(&aac_bfi); @@ -68,23 +65,12 @@ gnac_profiles_aac_init(void) gnac_profiles_utils_init_widget(&aac_bfi, "combo-bitrate", "//variable[@id='bitrate']"); - // Profile - widget = gnac_profiles_utils_init_widget(&aac_bfi, "combo-profile", - "//variable[@id='profile']"); - widget2 = gnac_profiles_utils_get_widget(&aac_bfi, "label-profile"), - gnac_profiles_utils_add_description_tooltip(&aac_bfi, - "//variable[@id='profile']/description", widget, widget2, NULL); - // Tns widget = gnac_profiles_utils_init_widget(&aac_bfi, "checkbutton-tns", "//variable[@id='tns']"); gnac_profiles_utils_add_description_tooltip(&aac_bfi, "//variable[@id='tns']/description", widget, NULL); - // Outputformat - gnac_profiles_utils_init_widget(&aac_bfi, "combo-outputformat", - "//variable[@id='outputformat']"); - gnac_profiles_xml_engine_free_doc_xpath(aac_bfi.doc); aac_bfi.doc = NULL; @@ -97,11 +83,12 @@ gnac_profiles_aac_generate_pipeline(void) { gchar *pipeline = gnac_profiles_default_generate_pipeline(&aac_bfi); pipeline = gnac_profiles_utils_add_properties(pipeline, &aac_bfi, - "combo-bitrate", "combo-outputformat", - "combo-profile", "checkbutton-tns", NULL); + "combo-bitrate", "checkbutton-tns", NULL); gnac_profiles_properties_update_textbuffer(pipeline); + pipeline = gnac_profiles_utils_add_pipe(pipeline, "audio/mpeg, mpegversion=4, stream-format=adts ! aacparse"); + g_free(aac_bfi.pipeline); aac_bfi.pipeline = pipeline; @@ -113,8 +100,7 @@ gnac_profiles_aac_reset_ui(void) { gnac_profiles_default_reset_ui(&aac_bfi); gnac_profiles_utils_reset_values(&aac_bfi, - "combo-bitrate", "combo-outputformat", - "combo-profile", "checkbutton-tns", NULL); + "combo-bitrate", "checkbutton-tns", NULL); } @@ -129,8 +115,6 @@ gnac_profiles_aac_set_fields(gpointer data) AudioProfileAAC *profile = (AudioProfileAAC *) data; gnac_profiles_utils_set_values(&aac_bfi, "combo-bitrate", profile->bitrate, - "combo-outputformat", profile->outputformat, - "combo-profile", profile->profile, "checkbutton-tns", profile->tns, NULL); } @@ -153,8 +137,6 @@ gnac_profiles_aac_free_audio_profile(gpointer data) gnac_profiles_utils_free_audio_profile_generic(profile->generic); g_free(profile->bitrate); - g_free(profile->outputformat); - g_free(profile->profile); g_free(profile->tns); g_free(profile); } @@ -171,8 +153,6 @@ gnac_profiles_aac_generate_audio_profile(GError **error) gnac_profiles_utils_get_values_and_set(&aac_bfi, "combo-bitrate", &profile->bitrate, - "combo-outputformat", &profile->outputformat, - "combo-profile", &profile->profile, "checkbutton-tns", &profile->tns, NULL); @@ -196,8 +176,6 @@ gnac_profiles_aac_save_profile(gpointer data) XMLDoc *doc = gnac_profiles_default_save_profile(profile->generic, &aac_bfi); gnac_profiles_xml_engine_add_values(doc, "bitrate", profile->bitrate, - "outputformat", profile->outputformat, - "profile", profile->profile, "tns", profile->tns, NULL); gnac_profiles_xml_engine_save_doc(doc, profile->generic->name); @@ -216,8 +194,6 @@ gnac_profiles_aac_load_specific_properties(XMLDoc *doc, gnac_profiles_utils_load_saved_profile(doc, "/audio-profile/format-specific/", "bitrate", &profile->bitrate, - "outputformat", &profile->outputformat, - "profile", &profile->profile, "tns", &profile->tns, NULL); @@ -230,8 +206,7 @@ gnac_profiles_aac_clean_up(void) { gnac_profiles_default_clean_up(&aac_bfi); gnac_profiles_utils_free_values(&aac_bfi, - "combo-bitrate", "combo-outputformat", - "combo-profile", "checkbutton-tns", NULL); + "combo-bitrate", "checkbutton-tns", NULL); gnac_profiles_utils_free_basic_format_info(&aac_bfi); } diff --git a/src/profiles/formats/gnac-profiles-lame.c b/src/profiles/formats/gnac-profiles-lame.c index b3906b2..661e609 100755 --- a/src/profiles/formats/gnac-profiles-lame.c +++ b/src/profiles/formats/gnac-profiles-lame.c @@ -33,26 +33,17 @@ typedef struct { AudioProfileGeneric *generic; - gchar *encoding_mode; + gchar *target; gdouble quality; - gdouble compression_ratio; gchar *bitrate; - gchar *preset; - gdouble mean_abr; - gdouble mean_bitrate; - gchar *min_bitrate; - gchar *max_bitrate; - gchar *mode; + gchar *mono; } AudioProfileLame; typedef enum { - CONSTANT_BITRATE, - AVERAGE_BITRATE, - VARIABLE_BITRATE, - PRESETS, - COMPRESSION_RATIO -} EncodingMode; + QUALITY, + BITRATE, +} Target; BasicFormatInfo lame_bfi = { PKGDATADIR "/profiles/gnac-profiles-lame.xml", @@ -78,7 +69,7 @@ gnac_profiles_lame_audio_profile_new(void); void -gnac_profiles_lame_on_encoding_mode_changed(GtkComboBox *widget, +gnac_profiles_lame_on_target_changed(GtkComboBox *widget, gpointer user_data) { gnac_profiles_lame_vbr_on_changed(widget); @@ -90,7 +81,6 @@ static const gchar * gnac_profiles_lame_init(void) { GtkWidget *widget; - GtkWidget *widget2; gnac_profiles_default_init(&lame_bfi); @@ -102,42 +92,13 @@ gnac_profiles_lame_init(void) gnac_profiles_utils_init_widget(&lame_bfi, "slider-vbr-quality", "//variable[@id='quality']"); - // Compression ratio - widget = gnac_profiles_utils_init_widget(&lame_bfi, - "slider-compression-ratio", "//variable[@id='compression-ratio']"); - widget2 = gnac_profiles_utils_get_widget(&lame_bfi, - "label-compression-ratio"); - gnac_profiles_utils_add_description_tooltip(&lame_bfi, - "//variable[@id='compression-ratio']/description", - widget, widget2, NULL); - - // Preset - gnac_profiles_utils_init_widget(&lame_bfi, "combo-preset", - "//variable[@id='preset']"); - - // Abr bitrate - gnac_profiles_utils_init_widget(&lame_bfi, "slider-mean-abr", - "//variable[@id='mean-bitrate']"); - // Mode - gnac_profiles_utils_init_widget(&lame_bfi, "combo-mode", - "//variable[@id='mode']"); - - // Mean bitrate - gnac_profiles_utils_init_widget(&lame_bfi, "slider-mean-vbr", - "//variable[@id='mean-bitrate']"); + gnac_profiles_utils_init_widget(&lame_bfi, "combo-mono", + "//variable[@id='mono']"); - // Min bitrate - gnac_profiles_utils_init_widget(&lame_bfi, "combo-min-vbr", - "//variable[@id='min-bitrate']"); - - // Max bitrate - gnac_profiles_utils_init_widget(&lame_bfi, "combo-max-vbr", - "//variable[@id='max-bitrate']"); - - // Encoding mode - widget = gnac_profiles_utils_init_widget(&lame_bfi, "combo-encoding-mode", - "//variable[@id='encoding-mode']"); + // Target + widget = gnac_profiles_utils_init_widget(&lame_bfi, "combo-target", + "//variable[@id='target']"); gnac_profiles_lame_vbr_on_changed(GTK_COMBO_BOX(widget)); @@ -149,26 +110,6 @@ gnac_profiles_lame_init(void) static void -gnac_profiles_lame_show_abr_widgets(gboolean show) -{ - GtkWidget *abr_widgets[] = { - gnac_profiles_utils_get_widget(&lame_bfi, "label-mean-bitrate"), - gnac_profiles_utils_get_widget(&lame_bfi, "slider-mean-abr"), - gnac_profiles_utils_get_widget(&lame_bfi, "checkbutton-min-bitrate"), - gnac_profiles_utils_get_widget(&lame_bfi, "combo-min-vbr"), - gnac_profiles_utils_get_widget(&lame_bfi, "checkbutton-max-bitrate"), - gnac_profiles_utils_get_widget(&lame_bfi, "combo-max-vbr") - }; - - guint i; - for (i = 0; i < G_N_ELEMENTS(abr_widgets); i++) { - if (show) gtk_widget_show_all(abr_widgets[i]); - else gtk_widget_hide(abr_widgets[i]); - } -} - - -static void gnac_profiles_lame_show_cbr_widgets(gboolean show) { GtkWidget *cbr_widgets[] = { @@ -190,12 +131,6 @@ gnac_profiles_lame_show_vbr_widgets(gboolean show) GtkWidget *vbr_widgets[] = { gnac_profiles_utils_get_widget(&lame_bfi, "label-vbr"), gnac_profiles_utils_get_widget(&lame_bfi, "hbox-vbr"), - gnac_profiles_utils_get_widget(&lame_bfi, "checkbutton-mean-bitrate"), - gnac_profiles_utils_get_widget(&lame_bfi, "slider-mean-vbr"), - gnac_profiles_utils_get_widget(&lame_bfi, "checkbutton-min-bitrate"), - gnac_profiles_utils_get_widget(&lame_bfi, "combo-min-vbr"), - gnac_profiles_utils_get_widget(&lame_bfi, "checkbutton-max-bitrate"), - gnac_profiles_utils_get_widget(&lame_bfi, "combo-max-vbr") }; guint i; @@ -207,48 +142,12 @@ gnac_profiles_lame_show_vbr_widgets(gboolean show) static void -gnac_profiles_lame_show_presets_widgets(gboolean show) -{ - GtkWidget *presets_widgets[] = { - gnac_profiles_utils_get_widget(&lame_bfi, "label-preset"), - gnac_profiles_utils_get_widget(&lame_bfi, "hbox-preset"), - }; - - guint i; - for (i = 0; i < G_N_ELEMENTS(presets_widgets); i++) { - if (show) gtk_widget_show_all(presets_widgets[i]); - else gtk_widget_hide(presets_widgets[i]); - } -} - - -static void -gnac_profiles_lame_show_compression_ratio_widgets(gboolean show) -{ - GtkWidget *compression_ratio_widgets[] = { - gnac_profiles_utils_get_widget(&lame_bfi, "label-compression-ratio"), - gnac_profiles_utils_get_widget(&lame_bfi, "slider-compression-ratio"), - }; - - guint i; - for (i = 0; i < G_N_ELEMENTS(compression_ratio_widgets); i++) { - if (show) gtk_widget_show_all(compression_ratio_widgets[i]); - else gtk_widget_hide(compression_ratio_widgets[i]); - } -} - - -static void gnac_profiles_lame_vbr_on_changed(GtkComboBox *widget) { - EncodingMode encoding_mode = gtk_combo_box_get_active(GTK_COMBO_BOX(widget)); - - gnac_profiles_lame_show_abr_widgets(encoding_mode == AVERAGE_BITRATE); - gnac_profiles_lame_show_cbr_widgets(encoding_mode == CONSTANT_BITRATE); - gnac_profiles_lame_show_vbr_widgets(encoding_mode == VARIABLE_BITRATE); - gnac_profiles_lame_show_presets_widgets(encoding_mode == PRESETS); - gnac_profiles_lame_show_compression_ratio_widgets( - encoding_mode == COMPRESSION_RATIO); + Target target = gtk_combo_box_get_active(GTK_COMBO_BOX(widget)); + + gnac_profiles_lame_show_cbr_widgets(target == BITRATE); + gnac_profiles_lame_show_vbr_widgets(target == QUALITY); } @@ -257,54 +156,25 @@ gnac_profiles_lame_generate_pipeline(void) { gchar *pipeline = gnac_profiles_default_generate_pipeline(&lame_bfi); GtkWidget *widget = gnac_profiles_utils_get_widget(&lame_bfi, - "combo-encoding-mode"); - EncodingMode encoding_mode = gtk_combo_box_get_active(GTK_COMBO_BOX(widget)); + "combo-target"); + Target target = gtk_combo_box_get_active(GTK_COMBO_BOX(widget)); // Mode pipeline = gnac_profiles_utils_add_properties(pipeline, &lame_bfi, - "combo-mode", NULL); + "combo-mono", NULL); - switch (encoding_mode) + switch (target) { - case CONSTANT_BITRATE: - pipeline = gnac_profiles_utils_add_properties(pipeline, &lame_bfi, - "combo-encoding-mode", "combo-bitrate", NULL); - break; - - case AVERAGE_BITRATE: + case BITRATE: pipeline = gnac_profiles_utils_add_properties(pipeline, &lame_bfi, - "combo-encoding-mode", NULL); - pipeline = gnac_profiles_utils_add_properties_slider(pipeline, &lame_bfi, - "%.0f", "slider-mean-abr", NULL); - pipeline = gnac_profiles_utils_add_properties_checked_combo(pipeline, - &lame_bfi, - "combo-min-vbr", "checkbutton-min-bitrate", - "combo-max-vbr", "checkbutton-max-bitrate", - NULL); + "combo-target", "combo-bitrate", NULL); break; - case VARIABLE_BITRATE: + case QUALITY: pipeline = gnac_profiles_utils_add_properties(pipeline, &lame_bfi, - "combo-encoding-mode", NULL); + "combo-target", NULL); pipeline = gnac_profiles_utils_add_properties_slider(pipeline, &lame_bfi, "%.0f", "slider-vbr-quality", NULL); - pipeline = gnac_profiles_utils_add_properties_checked_slider(pipeline, - &lame_bfi, "slider-mean-vbr", "checkbutton-mean-bitrate", NULL); - pipeline = gnac_profiles_utils_add_properties_checked_combo(pipeline, - &lame_bfi, - "combo-min-vbr", "checkbutton-min-bitrate", - "combo-max-vbr", "checkbutton-max-bitrate", - NULL); - break; - - case PRESETS: - pipeline = gnac_profiles_utils_add_properties(pipeline, &lame_bfi, - "combo-preset", NULL); - break; - - case COMPRESSION_RATIO: - pipeline = gnac_profiles_utils_add_properties_slider(pipeline, &lame_bfi, - "%.0f", "slider-compression-ratio", NULL); break; default: @@ -321,26 +191,12 @@ gnac_profiles_lame_generate_pipeline(void) } -void -gnac_profiles_lame_advanced_bitrate_on_toggle(GtkWidget *widget, - GtkToggleButton *togglebutton) -{ - gnac_profiles_utils_on_toggle_optionnal_property(togglebutton, widget); - gnac_profiles_lame_generate_pipeline(); -} - - static void gnac_profiles_lame_reset_ui(void) { gnac_profiles_utils_reset_values(&lame_bfi, - "combo-mode", "combo-bitrate", "combo-min-vbr", "combo-max-vbr", - "combo-preset", "combo-encoding-mode", "slider-vbr-quality", - "slider-compression-ratio", "slider-mean-vbr", "slider-mean-abr", + "combo-mono", "combo-bitrate", "combo-target", "slider-vbr-quality", NULL); - gnac_profiles_utils_set_active_toggle_button(&lame_bfi, FALSE, - "checkbutton-mean-bitrate", "checkbutton-min-bitrate", - "checkbutton-max-bitrate", NULL); } @@ -354,42 +210,18 @@ gnac_profiles_lame_set_fields(gpointer data) AudioProfileLame *profile = (AudioProfileLame *) data; gnac_profiles_utils_set_values(&lame_bfi, - "combo-encoding-mode", profile->encoding_mode, - "combo-mode", profile->mode, NULL); + "combo-target", profile->target, + "combo-mono", profile->mono, NULL); if (profile->bitrate) { gnac_profiles_utils_set_values(&lame_bfi, "combo-bitrate", profile->bitrate, NULL); } - else if (profile->preset) - { - gnac_profiles_utils_set_values(&lame_bfi, - "combo-preset", profile->preset, NULL); - } - else if (profile->mean_abr != -1) - { - gnac_profiles_utils_set_values(&lame_bfi, - "slider-mean-abr", profile->mean_abr, NULL); - gnac_profiles_utils_set_values_checked(&lame_bfi, - "combo-min-vbr", "checkbutton-min-bitrate", profile->min_bitrate, - "combo-max-vbr", "checkbutton-max-bitrate", profile->max_bitrate, - NULL); - } else if (profile->quality != -1) { gnac_profiles_utils_set_values(&lame_bfi, "slider-vbr-quality", profile->quality, NULL); - gnac_profiles_utils_set_values_checked(&lame_bfi, - "combo-min-vbr", "checkbutton-min-bitrate", profile->min_bitrate, - "combo-max-vbr", "checkbutton-max-bitrate", profile->max_bitrate, - "slider-mean-vbr", "checkbutton-mean-bitrate", profile->mean_bitrate, - NULL); - } - else if (profile->compression_ratio != -1) - { - gnac_profiles_utils_set_values(&lame_bfi, - "slider-compression-ratio", profile->compression_ratio, NULL); } } @@ -406,16 +238,10 @@ gnac_profiles_lame_audio_profile_new(void) { AudioProfileLame *profile = g_malloc(sizeof(AudioProfileLame)); - profile->encoding_mode = NULL; - profile->mode = NULL; + profile->target = NULL; + profile->mono = NULL; profile->bitrate = NULL; - profile->preset = NULL; profile->quality = -1; - profile->compression_ratio = -1; - profile->mean_bitrate = -1; - profile->mean_abr = -1; - profile->min_bitrate = NULL; - profile->max_bitrate = NULL; return profile; } @@ -428,12 +254,9 @@ gnac_profiles_lame_free_audio_profile(gpointer data) AudioProfileLame *profile = (AudioProfileLame *) data; gnac_profiles_utils_free_audio_profile_generic(profile->generic); - g_free(profile->encoding_mode); - g_free(profile->mode); + g_free(profile->target); + g_free(profile->mono); g_free(profile->bitrate); - g_free(profile->min_bitrate); - g_free(profile->max_bitrate); - g_free(profile->preset); g_free(profile); } @@ -447,49 +270,23 @@ gnac_profiles_lame_generate_audio_profile(GError **error) profile->generic = generic; gnac_profiles_utils_get_values_and_set(&lame_bfi, - "combo-encoding-mode", &profile->encoding_mode, - "combo-mode", &profile->mode, + "combo-target", &profile->target, + "combo-mono", &profile->mono, NULL); GtkWidget *widget = gnac_profiles_utils_get_widget(&lame_bfi, - "combo-encoding-mode"); + "combo-target"); switch (gtk_combo_box_get_active(GTK_COMBO_BOX(widget))) { - case CONSTANT_BITRATE: + case BITRATE: gnac_profiles_utils_get_values_and_set(&lame_bfi, "combo-bitrate", &profile->bitrate, NULL); break; - case AVERAGE_BITRATE: - gnac_profiles_utils_get_values_and_set(&lame_bfi, - "slider-mean-abr", &profile->mean_abr, NULL); - gnac_profiles_utils_get_values_checked_combo_and_set(&lame_bfi, - "combo-min-vbr", "checkbutton-min-bitrate", &profile->min_bitrate, - "combo-max-vbr", "checkbutton-max-bitrate", &profile->max_bitrate, - NULL ); - break; - - case VARIABLE_BITRATE: + case QUALITY: gnac_profiles_utils_get_values_and_set(&lame_bfi, "slider-vbr-quality", &profile->quality, NULL); - gnac_profiles_utils_get_values_checked_slider_and_set(&lame_bfi, - "slider-mean-vbr", "checkbutton-mean-bitrate", &profile->mean_bitrate, - NULL); - gnac_profiles_utils_get_values_checked_combo_and_set(&lame_bfi, - "combo-min-vbr", "checkbutton-min-bitrate", &profile->min_bitrate, - "combo-max-vbr", "checkbutton-max-bitrate", &profile->max_bitrate, - NULL ); - break; - - case PRESETS: - gnac_profiles_utils_get_values_and_set(&lame_bfi, - "combo-preset", &profile->preset, NULL); - break; - - case COMPRESSION_RATIO: - gnac_profiles_utils_get_values_and_set(&lame_bfi, - "slider-compression-ratio", &profile->compression_ratio, NULL); break; default: @@ -513,49 +310,25 @@ gnac_profiles_lame_save_profile(gpointer data) if (!data) return; gchar *quality = NULL; - gchar *mean_bitrate = NULL; - gchar *mean_abr = NULL; - gchar *compression_ratio = NULL; AudioProfileLame *profile = (AudioProfileLame *) data; if (profile->quality != -1) { quality = gnac_profiles_utils_gdouble_to_gchararray(profile->quality); - - if (profile->mean_bitrate != -1) { - mean_bitrate = gnac_profiles_utils_gdouble_to_gchararray( - profile->mean_bitrate); - } - } - else if (profile->mean_abr != -1) - { - mean_abr = gnac_profiles_utils_gdouble_to_gchararray(profile->mean_abr); - } - else if (profile->compression_ratio != -1) { - compression_ratio = gnac_profiles_utils_gdouble_to_gchararray( - profile->compression_ratio); } XMLDoc *doc = gnac_profiles_default_save_profile(profile->generic, &lame_bfi); gnac_profiles_xml_engine_add_values(doc, - "encoding-mode", profile->encoding_mode, + "target", profile->target, "bitrate", profile->bitrate, "quality", quality, - "compression-ratio", compression_ratio, - "preset", profile->preset, - "mean-abr", mean_abr, - "mean-bitrate", mean_bitrate, - "min-bitrate", profile->min_bitrate, - "max-bitrate", profile->max_bitrate, - "mode", profile->mode, + "mono", profile->mono, NULL); gnac_profiles_xml_engine_save_doc(doc, profile->generic->name); gnac_profiles_xml_engine_free_doc_xpath(doc); g_free(quality); - g_free(mean_bitrate); - g_free(compression_ratio); } @@ -564,42 +337,20 @@ gnac_profiles_lame_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic) { gchar *quality; - gchar *mean_bitrate; - gchar *mean_abr; - gchar *compression_ratio; AudioProfileLame *profile = gnac_profiles_lame_audio_profile_new(); profile->generic = generic; gnac_profiles_utils_load_saved_profile(doc, "/audio-profile/format-specific/", - "encoding-mode", &profile->encoding_mode, + "target", &profile->target, "bitrate", &profile->bitrate, "quality", &quality, - "compression-ratio", &compression_ratio, - "preset", &profile->preset, - "mean-abr", &mean_abr, - "mean-bitrate", &mean_bitrate, - "min-bitrate", &profile->min_bitrate, - "max-bitrate", &profile->max_bitrate, - "mode", &profile->mode, + "mono", &profile->mono, NULL); if (quality) { profile->quality = gnac_profiles_utils_gchararray_to_gdouble(quality); g_free(quality); - - if (mean_bitrate) { - profile->mean_bitrate = gnac_profiles_utils_gchararray_to_gdouble( - mean_bitrate); - g_free(mean_bitrate); - } - } else if (mean_abr) { - profile->mean_abr = gnac_profiles_utils_gchararray_to_gdouble(mean_abr); - g_free(mean_abr); - } else if (compression_ratio) { - profile->compression_ratio = gnac_profiles_utils_gchararray_to_gdouble( - compression_ratio); - g_free(compression_ratio); } return profile; @@ -611,9 +362,7 @@ gnac_profiles_lame_clean_up(void) { gnac_profiles_default_clean_up(&lame_bfi); gnac_profiles_utils_free_values(&lame_bfi, - "combo-mode", "combo-bitrate", "combo-min-vbr", "combo-max-vbr", - "combo-preset", "combo-encoding-mode", "slider-vbr-quality", - "slider-compression-ratio", "slider-mean-vbr", "slider-mean-abr", + "combo-mono", "combo-bitrate", "combo-target", "slider-vbr-quality", NULL); gnac_profiles_utils_free_basic_format_info(&lame_bfi); } diff --git a/src/profiles/formats/gnac-profiles-lame.h b/src/profiles/formats/gnac-profiles-lame.h index aa66083..522bb04 100644 --- a/src/profiles/formats/gnac-profiles-lame.h +++ b/src/profiles/formats/gnac-profiles-lame.h @@ -37,8 +37,8 @@ void gnac_profiles_lame_generate_pipeline(void); void -gnac_profiles_lame_on_encoding_mode_changed(GtkComboBox *widget, - gpointer user_data); +gnac_profiles_lame_on_target_changed(GtkComboBox *widget, + gpointer user_data); void gnac_profiles_lame_advanced_bitrate_on_toggle(GtkWidget *widget, diff --git a/src/profiles/formats/gnac-profiles-unknown.c b/src/profiles/formats/gnac-profiles-unknown.c index edf6957..4d7cb76 100644 --- a/src/profiles/formats/gnac-profiles-unknown.c +++ b/src/profiles/formats/gnac-profiles-unknown.c @@ -49,7 +49,7 @@ BasicFormatInfo unknown_bfi = { }; const gchar *base_pipeline = - "audioconvert ! audio/x-raw-float, rate=44100, channels=2 ! audioconvert !"; + "audioconvert ! audio/x-raw, rate=44100, channels=2 ! audioconvert !"; static GtkTextView *pipeline_text_view; static GtkWidget *pipeline_box; diff --git a/src/profiles/gnac-profiles-default.c b/src/profiles/gnac-profiles-default.c index 7ef94ba..04b8266 100755 --- a/src/profiles/gnac-profiles-default.c +++ b/src/profiles/gnac-profiles-default.c @@ -23,6 +23,7 @@ * Boston, MA 02110-1301 USA */ +#include <stdlib.h> #include <glib/gstdio.h> #include "gnac-main.h" -- 2.2.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor