[haiku-development] Re: video_mixer media node

  • From: sami vuokila <varjosanomat@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 12 Jul 2010 13:47:46 +0900

hello

i was trying to hack mixer to accept frames from mediaplayer buffer
producer so as to be able to mix any video streams opened with
mediaplayer

this of course requires scaling and color conversion inside the mixer
to accommodate for many kinds of input

gotta take another look at the code when i can afford some haiku time again

cheers
sami

On 7/12/10, David McPaul <dlmcpaul@xxxxxxxxx> wrote:
> On 28 June 2010 02:28, sami vuokila <varjosanomat@xxxxxxxxx> wrote:
>> bizarro city
>>
>> i changed get input & output format to enforce B_RGB32 like this
>>
>> void VideoMixerNode::GetInputFormat(media_format *outFormat)
>> {
>>        fprintf(stderr,"VideoMixerNode::GetInputFormat\n");
>>
>>        if (outFormat != NULL) {
>>                outFormat->type = B_MEDIA_RAW_VIDEO;
>>                outFormat->require_flags = B_MEDIA_MAUI_UNDEFINED_FLAGS;
>>                outFormat->deny_flags = B_MEDIA_MAUI_UNDEFINED_FLAGS;
>>                outFormat->u.raw_video = media_raw_video_format::wildcard;
>>                outFormat->u.raw_video.display.format = B_RGB32;
>>                // = media_raw_video_format::wildcard;
>>                //outFormat->u.raw_video =
>> media_raw_video_format::wildcard;
>>        }
>> }
>>
>> but still mediaplayer seems to think preferred color space is B_RGB32_BIG
>
> How does mediaplayer come into this?  MediaPlayer does not use the
> video mixer node.
>
> Are you using Cortex and the 3 nodes I mentioned (VideoProducer,
> VideoMixer, VideoWindow)?
>
>> the debug output is quite confusing, what is really going on in there?
>> Why does it not grok the colorspace im trying to enforce?
>> on cortex, the video stream (when you open a video file with
>> mediaplayer) shows as raw B_RGB32. apparently video_mixer returns a
>> wildcard as the preferred colorspace and mediaplayer does some
>> weirdness to resolve that wildcard is B_RGB32_big. ??
>
> There is a negotiation phase.
>
>                 BBufferProducer::FormatProposal
>                 BBufferConsumer::AcceptFormat
>                 BBufferProducer::PrepareToConnect
>                 BBufferConsumer::Connected
>                 BBufferProducer::Connect
>
>
> VideoProducer tells the next consumer what it can produce
> The consumer will either accept or reject (and if reject then supplies
> an alternative)
>
> VideoWindow is coded to try and consume B_YCbCr422 first and then
> fallback to any supplied RGB space or B_RGB32 depending on the
> negotiation.
>
> VideoProducer only produces B_RGB32
>
> VideoMixer since it is expecting to do color conversion does not
> enforce any colorspace and at the moment what comes in on the input is
> sent to the output.
>
> --
> Cheers
> David
>
>

Other related posts: