Original Xbox clients hacks



Hi list,

I've been trying to get transcoding working for my original xbox running xbmc4xbox. This is old hardware that can't decode x264 and aac.

What I want to achieve: Have rygel transcode any video to a lower definition/codec when using that device.
By looking at the code, I think the right profile is MPEG_TS_SD_EU_ISO.

For what I understand, I need enforce some kind of client detection using the user-agent in a ClientHacks derived class and tell
rygel to transcode everything to MPEG_TS_SD_EU_ISO. Correct ?


Looking at the code in other client hacks, I've found in rygel-xbox-hacks.vala which targets Xbox 360 that one way to that would be
to redefine the mime_type to something incorrect:

foreach (var resource in object.get_resource_list ()) {
    if (resource.mime_type == "video/x-msvideo") {
        resource.mime_type = "video/avi";
    } else if (resource.mime_type == "video/mpeg") {
        // Force transcoding for MPEG files
        resource.mime_type = "invalid/content";
    }
}

I've done that in my xbmc4xbox client hack as such:

foreach (var resource in object.get_resource_list ()) {
    if(resource.dlna_profile != "MPEG_TS_SD_EU_ISO"){
        resource.mime_type = "invalid/content";
    }
}

and it does work... with Kodi on a linux box (I set AGENT = ".*" to catch all for tests). I can seen in the debug logs that the transcoding machinery is triggered and works as expected. However, if I try the very same thing using XBMC4XBOX, _it doesn't work_. It just show up playing the "normal" file in the logs 'res/primary_http" with the 'invalid/content' in the 'Content Type'.

I'm obviously doing something/everything wrong. I don't fully understand how the request is processed at and which state the apply() and modify_headers() hooks are triggered.

How can I force rygel to transcode to a certain dlna_profile once I've caught the client with the right user-agent ?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]