rygel r741 - trunk/src/rygel
- From: zeeshanak svn gnome org
- To: svn-commits-list gnome org
- Subject: rygel r741 - trunk/src/rygel
- Date: Sat, 28 Mar 2009 00:44:02 +0000 (UTC)
Author: zeeshanak
Date: Sat Mar 28 00:44:02 2009
New Revision: 741
URL: http://svn.gnome.org/viewvc/rygel?rev=741&view=rev
Log:
'mime_type' and 'dlna_profile' are now props of base Transcoder.
Modified:
trunk/src/rygel/rygel-l16-transcoder.vala
trunk/src/rygel/rygel-mp2ts-transcoder.vala
trunk/src/rygel/rygel-mp3-transcoder.vala
trunk/src/rygel/rygel-transcoder.vala
Modified: trunk/src/rygel/rygel-l16-transcoder.vala
==============================================================================
--- trunk/src/rygel/rygel-l16-transcoder.vala (original)
+++ trunk/src/rygel/rygel-l16-transcoder.vala Sat Mar 28 00:44:02 2009
@@ -33,8 +33,9 @@
private const int ENDIANNESS = ByteOrder.BIG_ENDIAN; // Network byte order
private const bool SIGNED = true; // Network byte order
- private const string mime_type = "audio/L16;rate=44100;channels=2";
- private const string dlna_profile = "LPCM";
+ public L16Transcoder () {
+ base ("audio/L16;rate=44100;channels=2", "LPCM");
+ }
public override Element create_source (Element src) throws Error {
return new L16TranscoderBin (src,
@@ -50,13 +51,13 @@
MediaItem item,
TranscodeManager manager)
throws Error {
- if (this.mime_type_is_a (item.mime_type, L16Transcoder.mime_type)) {
+ if (this.mime_type_is_a (item.mime_type, this.mime_type)) {
return;
}
var res = manager.create_resource (item,
- L16Transcoder.mime_type,
- L16Transcoder.dlna_profile);
+ this.mime_type,
+ this.dlna_profile);
res.sample_freq = L16Transcoder.FREQUENCY;
res.n_audio_channels = L16Transcoder.CHANNELS;
@@ -66,7 +67,7 @@
}
internal override bool can_handle (string mime_type) {
- return mime_type == L16Transcoder.mime_type;
+ return mime_type == this.mime_type;
}
}
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 28 00:44:02 2009
@@ -26,13 +26,14 @@
using Gee;
internal class Rygel.MP2TSTranscoder : Rygel.Transcoder {
- public const string mime_type = "video/mpeg";
- private const string dlna_profile = "MPEG_TS_HD_NA";
-
// HD
private const int WIDTH = 1920;
private const int HEIGHT = 1080;
+ public MP2TSTranscoder () {
+ base ("video/mpeg", "MPEG_TS_HD_NA");
+ }
+
public override Element create_source (Element src) throws Error {
return new MP2TSTranscoderBin (src,
MP2TSTranscoder.WIDTH,
@@ -43,13 +44,13 @@
MediaItem item,
TranscodeManager manager)
throws Error {
- if (this.mime_type_is_a (item.mime_type, MP2TSTranscoder.mime_type)) {
+ if (this.mime_type_is_a (item.mime_type, this.mime_type)) {
return;
}
var res = manager.create_resource (item,
- MP2TSTranscoder.mime_type,
- MP2TSTranscoder.dlna_profile);
+ this.mime_type,
+ this.dlna_profile);
res.width = WIDTH;
res.height = HEIGHT;
@@ -57,7 +58,7 @@
}
internal override bool can_handle (string mime_type) {
- return mime_type == MP2TSTranscoder.mime_type;
+ return mime_type == this.mime_type;
}
}
Modified: trunk/src/rygel/rygel-mp3-transcoder.vala
==============================================================================
--- trunk/src/rygel/rygel-mp3-transcoder.vala (original)
+++ trunk/src/rygel/rygel-mp3-transcoder.vala Sat Mar 28 00:44:02 2009
@@ -31,12 +31,11 @@
}
internal class Rygel.MP3Transcoder : Rygel.Transcoder {
- public const string mime_type = "audio/mpeg";
- private const string dlna_profile = "MP3";
-
private MP3Profile layer;
public MP3Transcoder (MP3Profile layer) {
+ base ("audio/mpeg", "MP3");
+
this.layer = layer;
}
@@ -56,17 +55,17 @@
MediaItem item,
TranscodeManager manager)
throws Error {
- if (this.mime_type_is_a (item.mime_type, MP3Transcoder.mime_type)) {
+ if (this.mime_type_is_a (item.mime_type, this.mime_type)) {
return;
}
resources.add (manager.create_resource (item,
- MP3Transcoder.mime_type,
- MP3Transcoder.dlna_profile));
+ this.mime_type,
+ this.dlna_profile));
}
public override bool can_handle (string mime_type) {
- return mime_type == MP3Transcoder.mime_type;
+ return mime_type == this.mime_type;
}
}
Modified: trunk/src/rygel/rygel-transcoder.vala
==============================================================================
--- trunk/src/rygel/rygel-transcoder.vala (original)
+++ trunk/src/rygel/rygel-transcoder.vala Sat Mar 28 00:44:02 2009
@@ -26,6 +26,14 @@
using Gee;
internal abstract class Rygel.Transcoder : GLib.Object {
+ public string mime_type { get; protected set; }
+ public string dlna_profile { get; protected set; }
+
+ public Transcoder (string mime_type, string dlna_profile) {
+ this.mime_type = mime_type;
+ this.dlna_profile = dlna_profile;
+ }
+
public abstract Element create_source (Element src) throws Error;
public abstract void add_resources (ArrayList<DIDLLiteResource?> resources,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]