MythTV
From Cmcl
MythTV stuff
Contents |
Mytv install
sudo apt-get install build-essential liblircclient-dev libasound2-dev libdts-dev libdvdnav-dev libxv-dev libxxf86vm-dev transcode subversion qt4-dev-tools libqt4-dev libsamplerate0 libxvidcore4 liba52-0.7.4-dev libfame-dev libcdio-dev msttcorefonts libasound2-doc libmad0-dev libid3tag0-dev libvorbis-dev libflac-dev libcdaudio-dev libcdparanoia0-dev fftw3-dev libfaad-dev libsmpeg-dev libmp4v2-dev libtag1-dev mysql-server libvisual-0.4-dev libexif-dev libpulse-dev ibmp3lame-dev
MythProxy Information
The included makefile should make the "MythProxy" executable. Command Line options, taken from MythProxy --help are as follows:
- Usage: MythProxy [OPTION...]
-
- -h, --hostname=HOSTNAME Set the hostname. Default is "mbe"
- -p, --port=PORT Set the port number to listen on. Default is 6543
- -v, --verbose=VERBOSITY Set verbosity options defined in a CSV list. Use
- -v help to see all options
- -?, --help Give this help list
- --usage Give a short usage message
- Mandatory or optional arguments to long options are also mandatory or optional
- for any corresponding short options.
(Note -- I have not tested these options extensively. However, I'm pretty sure that they work)
Now, to hook up with mythfrontend, run MythProxy with the hostname and port that the real backend would be running on. Then, run mythfrontend and it should be able to talk to the MythProxy. Use the "-v network,socket" option on mythfrontend to see the communications.
IMPORTANT: Note that currently, the recordings list and set of storage directories (Look at recording.cpp at the getFormattedRecList() function and at the main function's Recording:storageDirs initialization respectively) is hard-coded to the recordings available on the intel1 homenet node. So, if you run the application on a node without the specified directories and files, you will be able to get a list of recordings, but none will play.
Populator information
Command line options are described by running "populator --help". The following information is regarding data storage format: Key size is currently restricted to a 32 bits. We can change this once variable-size keys are supported by the DiskDB. However, you may change the Movie ID (mid) and Chunk ID (cid) sizes. Note that the sum of these two sizes, plus one, cannot exceed 32. The key itself is constructed as a concatenation of mid, a toggle bit, and the cid
When storing the mid->cid(s) map, there is a prefix of 20 bytes. The first 8 bytes of this prefix is the size of the movie. The second 4 bytes is the size of a chunk. The third 4 bytes are the size of the cid, in bits. The fourth 4 bytes is the number of chunks. This prefix is then followed by the cids; each is the minimum number of bytes required to store cid size bits.
IMPORTANT: the values of the prefix are in big-endian. Remember to convert for your machine, or it will break!
The key->location map returns a struct in_addr. This can be converted to a string notation using inet_ntop(). Note that the populator currently only supports IPv4 addresses.
To differentiate between getting locations, and getting data, the middle bit of the key is used a toggle. That is, if mid is 10 bits and cid is 12 bits, the key is 23 bits, with the 11th bit being the toggle bit. If the bit is set to 0, the location is retieved. If it is set to 1, the data is retrieved.
frontend
RingBuffer does all reading and writing of A/V files for both TV (playback) and TVRec, including streaming over network connections to the frontend's RingBuffer.
When watching "Live TV" the recorder records whatever the frontend requests and streams it out using the RingBuffer, this may be to disk or over the network. When watching pre-recorded programs TVRec simply streams a file on disk out using the RingBuffer. When just watching a recording, TVRec continues a recording started as recording-only while simultaneously streaming out using the RingBuffer. Finally, when in the recording-only mode the recording is only saved to disk using RingBuffer and no streaming to the frontend is performed.
When watching a pre-recorded stream, a recording is streamed from TVRec's RingBuffer to TV's RingBuffer
http://miffteevee.co.uk/documentation/development/classVideoOutput.html http://miffteevee.co.uk/documentation/development/modules.html
- play back begins from here
./programs/mythfrontend/playbackbox.cpp
PlaybackBox::playSelected()
- In TV::StartTV, it sends event for playback
TV::Init() opens up the playback screen (window)
void MythContext::sendPlaybackStart(void)
{
MythEvent me(QString("PLAYBACK_START %1").arg(GetHostName()));
dispatchNow(me);
}
v->Playback(curProgram)
- opening and reading remote file
lib/libmytv/remotefile.cpp RingBuffer::OpenFile ()
-> new RemoteFile(filename)
RemoteFile::Read() lib/libmytv/remotefile.cpp
NuppelVideoPlayer::StartPlaying is where it has a main decoder loop.
frontend How recording plays
- Play sequence
Playbackbox::playSelected
-> Playbackbox::play
-> TV::StartTV (libs/libmythtv/tv_play.cpp)
-> new TV()
-> TV::Init()
-> TV::Playback()
-> sets playbackinfo (ProgramInfo*) (telling which program to start)
-> ChangeState(kState_WatchingPreReorded) if (currtime < rec_end_ts)
TV::Init()
-> create a new thread for event (EventThread)
-> RunTV loops
-> detect state change
-> HandleStateChange();
-> if (state== kState_WatchingPreReorded) TV::StartPlayer()
-> SetupPlayer()
-> nvp = new NuppleVideoPlayer("player", playbackinfo);
-> nvp->SetRingBuffer(prbuffer)
-> nvp->SetLength(plabackLen);
-> Create a new thread and run SpawnDecode()
-> NuppleVideoPlayer::StartPlaying
-> spawn a KickoffOutputVideoLoop
-> NVP::OuputVideoLoop
-> decode loop
/* \fn TV::LoadExternalSubtitles(NuppelVideoPlayer*, const QString&)
* \brief Loads any external subtitles.
*
* This tries to find an external subtitle file in the same directory
* in which the video file is. It then tries to parse each found
* candidate file until one is parsed succesfully.
*/
bool TV::LoadExternalSubtitles(NuppelVideoPlayer *nvp,
const QString &videoFile)
diskAPI
key
For Movie ID use: 1st byte = META_META_REQUEST and the next 20 bytes are SHA of the movie name. For Chunk Location Information use: 1st byte = META_REQUEST and the next 20 bytes are the SHA of the chunk content. For Chunk data use: 1st byte = CHUNK_REQUEST and the next 20 bytes are the SHA of the chunk content. For CRC data use: 1st byte = CRC_REQUEST and the next 20 bytes are the SHA of the chunk content.
