rygel r703 - trunk/src/rygel
- From: zeeshanak svn gnome org
- To: svn-commits-list gnome org
- Subject: rygel r703 - trunk/src/rygel
- Date: Sat, 21 Mar 2009 13:55:29 +0000 (UTC)
Author: zeeshanak
Date: Sat Mar 21 13:55:29 2009
New Revision: 703
URL: http://svn.gnome.org/viewvc/rygel?rev=703&view=rev
Log:
MP2TSTranscoder uses MP3Transcoder.create_encoder.
To avoid some code-duplication.
Modified:
trunk/src/rygel/rygel-mp2ts-transcoder.vala
Modified: trunk/src/rygel/rygel-mp2ts-transcoder.vala
==============================================================================
--- trunk/src/rygel/rygel-mp2ts-transcoder.vala (original)
+++ trunk/src/rygel/rygel-mp2ts-transcoder.vala Sat Mar 21 13:55:29 2009
@@ -41,7 +41,7 @@
"Required element '%s' missing", DECODEBIN);
}
- this.audio_enc = this.create_audio_encoder ();
+ this.audio_enc = MP3Transcoder.create_encoder (MP3Profile.LAYER2);
this.video_enc = ElementFactory.make (VIDEO_ENCODER, VIDEO_ENCODER);
if (video_enc == null) {
@@ -96,38 +96,6 @@
encoder.sync_state_with_parent ();
}
- private Element create_audio_encoder () throws Error {
- var convert = ElementFactory.make (AUDIO_CONVERT, AUDIO_CONVERT);
- if (convert == null) {
- throw new LiveResponseError.MISSING_PLUGIN (
- "Required element '%s' missing",
- AUDIO_CONVERT);
- }
-
- var encoder = ElementFactory.make (AUDIO_ENCODER, AUDIO_ENCODER);
- if (encoder == null) {
- throw new LiveResponseError.MISSING_PLUGIN (
- "Required element '%s' missing",
- AUDIO_ENCODER);
- }
-
- var bin = new Bin ("audio-encoder-bin");
- bin.add_many (convert, encoder);
-
- var filter = Caps.from_string ("audio/x-raw-int");
- convert.link_filtered (encoder, filter);
-
- var pad = convert.get_static_pad ("sink");
- var ghost = new GhostPad (null, pad);
- bin.add_pad (ghost);
-
- pad = encoder.get_static_pad ("src");
- ghost = new GhostPad (null, pad);
- bin.add_pad (ghost);
-
- return bin;
- }
-
private void post_error (Error error) {
Message msg = new Message.error (this, error, error.message);
this.post_message (msg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]