mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
run as source
This commit is contained in:
parent
439dac09c5
commit
fba5eb4a11
72 changed files with 9577 additions and 399 deletions
|
@ -48,7 +48,9 @@ class Player(object):
|
|||
if title:
|
||||
self.window.set_title(title)
|
||||
|
||||
if hasattr(self,'width') and hasattr(self,'height'):
|
||||
if kwargs.get("fullscreen"):
|
||||
self.window.fullscreen()
|
||||
elif hasattr(self,'width') and hasattr(self,'height'):
|
||||
self.window.set_default_size(self.width, self.height)
|
||||
|
||||
self.drawingarea = Gtk.DrawingArea()
|
||||
|
@ -96,10 +98,10 @@ class Player(object):
|
|||
if scale:
|
||||
gstcommand += "videoscale method=1 ! video/x-raw,width="+str(self.width)+",height="+str(self.height)+" ! "
|
||||
|
||||
gstcommand += "autovideosink "
|
||||
gstcommand += "autovideosink sync=false "
|
||||
|
||||
if audio:
|
||||
gstcommand += "demuxer. ! queue max-size-buffers=0 max-size-time=0 ! aacparse ! avdec_aac ! audioconvert ! audioresample ! autoaudiosink "
|
||||
gstcommand += "demuxer. ! queue max-size-buffers=0 max-size-time=0 ! aacparse ! avdec_aac ! audioconvert ! audioresample ! autoaudiosink sync=false "
|
||||
|
||||
self.pipeline = Gst.parse_launch(gstcommand)
|
||||
|
||||
|
@ -206,6 +208,7 @@ if __name__ == '__main__':
|
|||
parser.add_argument("--log-level", metavar="lvl", help="Maximum level for log messages")
|
||||
parser.add_argument("-p", "--port", type=int, default=7236, help="Port for rtsp")
|
||||
parser.add_argument("-a", "--audio", dest="audio", action="store_true", help="Enable audio support")
|
||||
parser.add_argument("-f", "--full-screen", dest="fullscreen", action="store_true", help="Enter full screen mode")
|
||||
parser.add_argument("-s", "--scale", metavar="WxH", help="Scale to resolution")
|
||||
parser.add_argument("-d", "--debug", help="Debug")
|
||||
parser.add_argument("--uibc", help="Enable UIBC")
|
||||
|
@ -216,7 +219,8 @@ if __name__ == '__main__':
|
|||
# " default VESA %08X\n"
|
||||
# " default HH %08X\n"
|
||||
parser.add_argument("-r", "--resolution", help="Resolution")
|
||||
parser.set_defaults(audio=True)
|
||||
parser.set_defaults(audio=False)
|
||||
parser.set_defaults(fullscreen=False)
|
||||
args = parser.parse_args()
|
||||
|
||||
p = Player(**vars(args))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue