Skip to content

Commit

Permalink
Add docs for live stream
Browse files Browse the repository at this point in the history
  • Loading branch information
ktnrg45 committed Jul 12, 2022
1 parent d28af2a commit 60a3c5a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Welcome to pyremoteplay's documentation!

readme
registering
live_stream
examples/examples
reference/modules

Expand Down
30 changes: 30 additions & 0 deletions docs/source/live_stream.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Audio / Video Stream
===============================================================================================

The live audio/video stream is exposed through the :class:`AVReceiver <pyremoteplay.receiver.AVReceiver>` class.

The `AVReceiver` class **must** be **subclassed** and have implementations for the
:meth:`AVReceiver.handle_video() <pyremoteplay.receiver.AVReceiver.handle_video>`
and
:meth:`AVReceiver.handle_audio() <pyremoteplay.receiver.AVReceiver.handle_audio>`
methods. The audio and video frames that are passed to these methods are `pyav <https://pyav.org/docs/stable/>`_ frames.

A generic receiver is provided in this library with the :class:`QueueReceiver <pyremoteplay.receiver.QueueReceiver>` class.

Usage
+++++++++++++++++++++++++++++++++++++++++++++
To use a receiver, the receiver must be passed as a keyword argument to the
:meth:`RPDevice.create_session <pyremoteplay.RPDevice.create_session>`
method like in the example below.

::

from pyremoteplay import RPDevice
from pyremoteplay.receiver import QueueReceiver

ip_address = "192.168.86.2"
device = RPDevice(ip_address)
device.get_status()
user = device.get_users()[0]
receiver = QueueReceiver()
device.create_session(user, receiver=receiver)

0 comments on commit 60a3c5a

Please sign in to comment.