diff --git a/docs/source/index.rst b/docs/source/index.rst index b53983e..18fa7db 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -8,6 +8,7 @@ Welcome to pyremoteplay's documentation! readme registering + live_stream examples/examples reference/modules diff --git a/docs/source/live_stream.rst b/docs/source/live_stream.rst new file mode 100644 index 0000000..150dc0c --- /dev/null +++ b/docs/source/live_stream.rst @@ -0,0 +1,30 @@ +Audio / Video Stream +=============================================================================================== + +The live audio/video stream is exposed through the :class:`AVReceiver ` class. + +The `AVReceiver` class **must** be **subclassed** and have implementations for the +:meth:`AVReceiver.handle_video() ` +and +:meth:`AVReceiver.handle_audio() ` +methods. The audio and video frames that are passed to these methods are `pyav `_ frames. + +A generic receiver is provided in this library with the :class:`QueueReceiver ` class. + +Usage ++++++++++++++++++++++++++++++++++++++++++++++ +To use a receiver, the receiver must be passed as a keyword argument to the +:meth:`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) \ No newline at end of file