All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Zaborowski <andrew.zaborowski@intel.com>
To: iwd@lists.01.org
Subject: [PATCH 12/13] wfd-source: Add stream utility buttons
Date: Fri, 31 Jul 2020 03:31:35 +0200	[thread overview]
Message-ID: <20200731013136.65057-12-andrew.zaborowski@intel.com> (raw)
In-Reply-To: <20200731013136.65057-1-andrew.zaborowski@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2176 bytes --]

Add two buttons to the UI when the stream is playing: one for forcing an
H.264 key-frame (IDR) and one for restarting the stream in gstreamer.
---
 test/wfd-source | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/test/wfd-source b/test/wfd-source
index 261ae750..4891c70c 100755
--- a/test/wfd-source
+++ b/test/wfd-source
@@ -588,6 +588,11 @@ class WFDRTSPServer:
         # TODO: can we also send this event directly to the element instead of the pad?
         sink.send_event(Gst.Event.new_custom(Gst.EventType.CUSTOM_DOWNSTREAM, s))
 
+    def reset_stream(self):
+        if self.rtp_pipeline.get_state(timeout=0)[1] == Gst.State.PLAYING:
+            self.rtp_pipeline.set_state(Gst.State.PAUSED)
+            self.rtp_pipeline.set_state(Gst.State.PLAYING)
+
     def rtsp_keepalive_timeout_cb(self):
         try:
             self.rtsp_keepalive_timeout = None
@@ -1311,6 +1316,25 @@ class WFDSource(Gtk.Window):
 
             self.add_info_str('Peer content protection', 'yes' if self.objects[path][WFD_IF]['HasContentProtection'] else 'no')
 
+        if peer.rtsp is not None and peer.rtsp.ready:
+            def force_keyframe(widget):
+                peer.rtsp.force_keyframe()
+                return True
+            def reset_stream(widget):
+                peer.rtsp.reset_stream()
+                return True
+            # The idea for these buttons is to make sure any parameter changes get fully applied
+            button1 = Gtk.Button()
+            button1.set_label('Force keyframe')
+            button1.connect('clicked', force_keyframe)
+            button2 = Gtk.Button()
+            button2.set_label('Reset stream')
+            button2.connect('clicked', reset_stream)
+            box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
+            box.pack_start(button1, expand=False, fill=False, padding=3)
+            box.pack_start(button2, expand=False, fill=False, padding=3)
+            self.infopane.add(box)
+
         if self.rtsp_props is None:
             self.rtsp_props, self.rtsp_init_values = WFDRTSPServer.get_init_props()
 
-- 
2.25.1

  parent reply	other threads:[~2020-07-31  1:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31  1:31 [PATCH 01/13] frame-xchg: Fix potential use after free Andrew Zaborowski
2020-07-31  1:31 ` [PATCH 02/13] frame-xchg: Improve search for current frame in MLME notify Andrew Zaborowski
2020-07-31  1:31 ` [PATCH 03/13] frame-xchg: Re-add frame_xchg_stop Andrew Zaborowski
2020-07-31  1:31 ` [PATCH 04/13] station: Comment/whitespace fix Andrew Zaborowski
2020-07-31  1:31 ` [PATCH 05/13] p2p: Retry connect on "Previous authentication not valid" Andrew Zaborowski
2020-07-31  1:31 ` [PATCH 06/13] p2p: Add a null-check before use Andrew Zaborowski
2020-07-31  1:31 ` [PATCH 07/13] p2p: Set p2p_own_wfd->available by default Andrew Zaborowski
2020-07-31  1:31 ` [PATCH 08/13] p2p: Use a longer DHCP timeout Andrew Zaborowski
2020-07-31  1:31 ` [PATCH 09/13] wfd-source: Print call trace on error Andrew Zaborowski
2020-07-31  1:31 ` [PATCH 10/13] wfd-source: Support wfd-idr-request Andrew Zaborowski
2020-07-31  1:31 ` [PATCH 11/13] wfd-source: Display some stream properties Andrew Zaborowski
2020-07-31  1:31 ` Andrew Zaborowski [this message]
2020-07-31  1:31 ` [PATCH 13/13] wfd-source: Allow alternative URLs in SETUP request Andrew Zaborowski
2020-07-31 15:40 ` [PATCH 01/13] frame-xchg: Fix potential use after free Denis Kenzior
2020-07-31 18:56   ` Andrew Zaborowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200731013136.65057-12-andrew.zaborowski@intel.com \
    --to=andrew.zaborowski@intel.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.