2008-07-29, 22:18
I've spent some free time over the last week screwing around with this concept. Here's what I've got so far.
Here's what I probe:
Video: stream number, language, codec, format, width, height, display aspect, frame rate
Audio: stream number, language, codec, sample rate, channels
Video's "format" probably isn't useful, it is just the internal format of the video data, e.g. yuv420p. Other than that, this information is remarkably similar to the information already held in memory in the CDVDStreamInfo classes for CDVDPlayer material. What I was thinking for this first stab is to add something like this to IPlayer:
int GetFileStreamCount();
bool GetFileStreamInfo(int iStream, CDVDStreamInfo& pStreamInfo);
I don't know if there's any advantage to creating a new CStreamInfo class that doesn't come from the dvdplayer core. Then way up in application before we do an IPlayer::CloseFile() just see if there is stream info and if there is, copy it to the CFileInfo for the currently playing item. Finally have that object commit the information to the database.
The first question would be, should the StreamInfo be split into multiple tables? At first I thought this would be a good idea but I'm wondering if it would just be easier to pull all from one.
CFileInfo will also need to load this information from the database, just like it does for CVideoInfoTag. Now here comes the big question, how is it exposed to the skins? The issue is that there can be multiple audio and video streams which means the information should probably be flattened for use in list items. How the heck would that work? I mean should there be IsVideoSD IsVideo720 IsVideo1080 to determine if it is HD? The next problem is the audio track info. Being able to display a "Dolby Digital 5.1" logo or something would be nice but that would mean having a list item tag for each type of audio which could get out of hand.
So long story short, that's how it could work as a first attempt. The next step after that would probably be adding it when a thumb is extracted and then on video library scan (correct me if I'm wrong but this doesn't open the file at all currently). What else am I missing here?
Here's what I probe:
Video: stream number, language, codec, format, width, height, display aspect, frame rate
Audio: stream number, language, codec, sample rate, channels
Video's "format" probably isn't useful, it is just the internal format of the video data, e.g. yuv420p. Other than that, this information is remarkably similar to the information already held in memory in the CDVDStreamInfo classes for CDVDPlayer material. What I was thinking for this first stab is to add something like this to IPlayer:
int GetFileStreamCount();
bool GetFileStreamInfo(int iStream, CDVDStreamInfo& pStreamInfo);
I don't know if there's any advantage to creating a new CStreamInfo class that doesn't come from the dvdplayer core. Then way up in application before we do an IPlayer::CloseFile() just see if there is stream info and if there is, copy it to the CFileInfo for the currently playing item. Finally have that object commit the information to the database.
The first question would be, should the StreamInfo be split into multiple tables? At first I thought this would be a good idea but I'm wondering if it would just be easier to pull all from one.
CFileInfo will also need to load this information from the database, just like it does for CVideoInfoTag. Now here comes the big question, how is it exposed to the skins? The issue is that there can be multiple audio and video streams which means the information should probably be flattened for use in list items. How the heck would that work? I mean should there be IsVideoSD IsVideo720 IsVideo1080 to determine if it is HD? The next problem is the audio track info. Being able to display a "Dolby Digital 5.1" logo or something would be nice but that would mean having a list item tag for each type of audio which could get out of hand.
So long story short, that's how it could work as a first attempt. The next step after that would probably be adding it when a thumb is extracted and then on video library scan (correct me if I'm wrong but this doesn't open the file at all currently). What else am I missing here?