Trials and tribulations of the MythTV protocol:
I can't find documentation about how the mythtv protocol works anywhere. It's a real pain in the ass to read the code and try to figure it out, so i thought i'd write something so that people don't have to hunt through the code.
Note, i wrote these during mythprotocol v 1, they seem to still work at v 8, but i haven't tried or checked the code. Use at your own risk.
Myth Protocol rules:
Commands work like this (dont ask how long it took me to figure this one out):
The first thing you send is the number of bytes that are in the current line. Then you send your command. Example:
20 MYTH_PROTO_VERSION 8
That will yeiled an "ACCEPTED" response.
Now we need to add ourselves to do stuff, this is done using the ANN command (otherwise the other functions dont work)
22 ANN Playback Myputer 0
Commands available through the protocol:
- ANN - Tells mythbackend "i'm here and i want to communicate" (Must be done to get any of the other commands to work)
- ANN Method Host Number
Method
- Playback - So far, Playback is the only method i know, lets you use query_getallpending and probably more
Host - Looks like you can put anything here, but your host name is most appropriate
Number - Possibly in case of multpile connections from one host, here's an ID number (i use 0)
- FileTransfer - I dunno
- RingBuffer - I dunno
- DONE - Tells mythbackend "im done, i wanna go home" (closes the port)
- QUERY_RECORDINGS - Dunno ditto
- QUERY_FREESPACE - check free space on server i guess
- QUERY_CHECKFILE - check if file exists i guess
- QUERY_TRANSCODE - maybe check if something transcoded?
- QUERY_TRANSCODE_CUTLIST - dunno, check for something transcoded with the cutlist used
- QUERY_TRANSCODE_STOP - Done adding witty quotes
- STOP_RECORDING
- CHECK_RECORDING
- DELETE_RECORDING
- FORGET_RECORDING
- QUERY_GETALLPENDING - ask for all shows to be recorded (back end sends it back in standard myth list form)
- QUERY_GETALLSCHEDULED
- QUERY_GETCONFLICTING
- GET_FREE_RECORDER
- GET_NEXT_FREE_RECORDER
- QUERY_RECORDER
- QUERY_REMOTEENCODER
- GET_RECORDER_FROM_NUM
- GET_RECORDER_NUM
- QUERY_FILETRANSFER
- QUERY_GENPIXMAP
- QUERY_ISRECORDING
- MESSAGE
- FILL_PROGRAM_INFO
- FILL_PROGRAM_INFO program string
Program string - the information you have in the myth program string format
don't know what it returns, although i think its the filled out program info you had missing when you sent in the program string
- LOCK_TUNER
- FREE_TUNER
- QUERY_IS_ACTIVE_BACKEND
- SHUTDOWN_NOW
- BACKEND_MESSAGE
So far, that's as far as i've gotten, good luck!