[transmageddon] Commit todays work, DVD ripping is now both closer and further away at the same time See bug https:/
- From: Christian Fredrik Kalager Schaller <uraeus src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [transmageddon] Commit todays work, DVD ripping is now both closer and further away at the same time See bug https:/
- Date: Sun, 31 Mar 2013 10:26:28 +0000 (UTC)
commit 0e0a4dd0fb152bab9bd5cd72a84b6bfb8aa5bcb9
Author: Christian Fredrik Kalager Schaller <uraeus linuxrising org>
Date: Sat Mar 30 17:41:11 2013 +0100
Commit todays work, DVD ripping is now both closer and further away at the same time
See bug https://bugzilla.gnome.org/show_bug.cgi?id=696915 for details
src/dvdtrackchooser.py | 14 ++++++++++----
src/transcoder_engine.py | 19 ++++++++++++++-----
src/transmageddon.py | 1 -
3 files changed, 24 insertions(+), 10 deletions(-)
---
diff --git a/src/dvdtrackchooser.py b/src/dvdtrackchooser.py
index 85a072b..aaef8f5 100644
--- a/src/dvdtrackchooser.py
+++ b/src/dvdtrackchooser.py
@@ -1,4 +1,4 @@
-import os,datetime
+import os,datetime, sys
from gi.repository import Gtk, GLib, Gst, GstTag
from gi.repository import GUdev
@@ -10,6 +10,12 @@ class dvdtrackchooser(Gtk.Dialog):
cancelbutton = self.dvdpickui.get_object("cancelbutton")
selectbutton = self.dvdpickui.get_object("selectbutton")
+ self.cachedir=GLib.get_user_cache_dir()+"/transmageddon"
+ CheckDir = os.path.isdir(self.cachedir)
+ if CheckDir == (False):
+ os.mkdir(self.cachedir)
+ sys.path.append(self.cachedir)
+
self.dvdpickui.connect_signals(self) # Initialize User Interface
self.dvdtrack=None # this will hold the selected DVD track value
self.isdvd=False
@@ -90,13 +96,13 @@ class dvdtrackchooser(Gtk.Dialog):
self.dvdwindow.destroy()
def dvdread(self, device):
- file = open('lsdvdout.py', 'w')
+ file = open('%s/lsdvdout.py' % self.cachedir, 'w')
file.write('#!/usr/bin/python3\n')
file.write('# -*- coding: ISO-8859-1 -*-\n')
file.close()
- cmd = 'lsdvd -a -Oy %s >> lsdvdout.py' % (device);
+ cmd = 'lsdvd -a -Oy %s >> %s/lsdvdout.py' % (device, self.cachedir);
os.system(cmd)
- # try:
+
from lsdvdout import lsdvd
self.Title = lsdvd['title']
self.Tracks = lsdvd['track']
diff --git a/src/transcoder_engine.py b/src/transcoder_engine.py
index 3be14dd..dc9fbd9 100644
--- a/src/transcoder_engine.py
+++ b/src/transcoder_engine.py
@@ -142,8 +142,6 @@ class Transcoder(GObject.GObject):
# including any extra elements between uridecodebin and encodebin
x=0
self.audioprofilenames=[]
- print("x is " +str(x))
- print(self.audiodata)
while x < len(self.audiodata):
if self.audiodata[x]['outputaudiocaps'] != False:
if self.container==False:
@@ -153,6 +151,7 @@ class Transcoder(GObject.GObject):
self.audioprofile =
GstPbutils.EncodingAudioProfile.new(self.audiodata[x]['outputaudiocaps'], audiopreset, Gst.Caps.new_any(), 0)
self.audioprofilenames.append("audioprofilename"+str(x))
self.audioprofile.set_name(self.audioprofilenames[x])
+ print("audioprofilenames " + str(self.audioprofilenames))
self.encodebinprofile.add_profile(self.audioprofile)
x=x+1
@@ -330,8 +329,9 @@ class Transcoder(GObject.GObject):
x=0
while x < len(self.audiodata):
if self.probestreamid==self.audiodata[x]['streamid']:
- self.sinkpad = self.encodebin.emit("request-profile-pad", self.audioprofilenames[x])
- pad.link(self.sinkpad)
+ print(str(pad)+" - "+"streamid from parse_stream_start "+ str(self.probestreamid))
+ self.sinkpad = self.encodebin.emit("request-profile-pad", self.audioprofilenames[x])
+ pad.link(self.sinkpad)
x=x+1
return Gst.PadProbeReturn.OK
@@ -397,8 +397,17 @@ class Transcoder(GObject.GObject):
if not c.startswith("audio/"):
self.sinkpad = self.encodebin.emit("request-pad", origin)
if c.startswith("audio/"):
+ # print(c)
if self.passcounter == int(0):
- src_pad.add_probe(Gst.PadProbeType.EVENT_DOWNSTREAM, self.padprobe, None)
+ stick=src_pad.get_sticky_event(Gst.EventType.STREAM_START, 0)
+ print(stick)
+ while x < len(self.audiodata):
+ if stick==self.audiodata[x]['streamid']:
+ #print(str(pad)+" - "+"streamid from parse_stream_start "+
str(self.probestreamid))
+ sinkpad = self.encodebin.emit("request-profile-pad",
self.audioprofilenames[x])
+ src_pad.link(sinkpad)
+ x=x+1
+ #src_pad.add_probe(Gst.PadProbeType.EVENT_DOWNSTREAM, self.padprobe, None)
elif ((c.startswith("video/") or c.startswith("image/")) and
(self.videodata[0]['outputvideocaps'] != False)):
if self.videodata[0]['dopassthrough']==False:
if (self.multipass != 0) and (self.passcounter != int(0)):
diff --git a/src/transmageddon.py b/src/transmageddon.py
index 73a8540..d67db6b 100644
--- a/src/transmageddon.py
+++ b/src/transmageddon.py
@@ -770,7 +770,6 @@ class TransmageddonUI(Gtk.ApplicationWindow):
if self.haveaudio == True:
y=0
count=len(self.audiostreamids)
- #print(self.audiostreamids)
while y < count:
if audiointersect[y].is_empty():
audiointersect[y] =
sourcecaps.intersect(self.audiodata[y]['inputaudiocaps'])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]