hashbrown

Hi,

I am writing a simple YUV media source to take in .yuv bytestreams and send it to the EVR. I have modified the MFT_Grayscale to act as a dummy transform to copy the yuv samples to the EVR. I am also using the playbackFX sample for the player.

I'm having a problem with the player just showing a black screen, as if no samples are being sent to the EVR. I have verified that the samples are being processed in the dummy transform with the correct image size and attributes for my given yuv sample. I have tried other yuv samples and all just display a black screen, but the samples are being processed for sure. Is there any way to debug this to see if the samples are being sent to the EVR Or does anyone have any clues why this is happening

Thanks!



Re: Media Foundation Development uncompressed YUV to EVR

ssmallfish

I met a similiar problem. In my problem, the video content can be seen when the WMP is in full screen mode and the black screen is shown when the WMP is in window mode. I am looking a solution also.






Re: Media Foundation Development uncompressed YUV to EVR

hashbrown

hi smallfish, i am using playbackFX sample though, not WMP. There does not seem to be a way to go to full screen with PlaybackFX.



Re: Media Foundation Development uncompressed YUV to EVR

Becky Weiss - MSFT

Yes, this sounds like it's a different issue from the couple of fullscreen issues we've been talking about.

One question: Do you happen to know whether this problem is specific to your video type (specifically the FourCC) or whether this happens for other FourCCs like YV12 It's fine if you don't have the means to determine this; this just might help us narrow down the problem a bit.






Re: Media Foundation Development uncompressed YUV to EVR

hashbrown

yes it happens with nv12, uyvy, and yuv2...all 3 formats...so it seems it is not related to the format or yuv sample.



Re: Media Foundation Development uncompressed YUV to EVR

Tony1972

hi

try to check start time and duration of your samples

it looks like they come to EVR later then the time they are stamped, so EVR just drops them...





Re: Media Foundation Development uncompressed YUV to EVR

hashbrown

hi tony,

since they are just yuv frames, i start the time at 0, and the duration of 1 second (10000000 100 nano second units). and i increment each timestamp by the duration for each frame.

is something wrong with this





Re: Media Foundation Development uncompressed YUV to EVR

Tony1972

hi

seems ok...

lets try this:

1) put original MFT_Grayscale instead of your transform

we'll narrow the problem to MFSource or MFT

2) post the code you use to create samples





Re: Media Foundation Development uncompressed YUV to EVR

hashbrown

Hi tony,

I will try to replace the MFT with the MFT_Grayscale. In the meantime, here is my sample creation code:

HRESULT YuvStream::CreateVideoSample(IMFSample **ppSample)

{

HRESULT hr = S_OK;

IMFMediaBuffer *pBuffer = NULL;

IMFSample *pSample = NULL;

ULONG cbRead = 0;

DWORD cbBuffer = 0;

BYTE *pData = NULL;

LONGLONG duration = 10000000;

BOOL bBufferLocked = FALSE;

cbBuffer = m_pSource->m_cbImageSize; //sample size

// Create the buffer.

hr = MFCreateMemoryBuffer(cbBuffer, &pBuffer);

if (SUCCEEDED(hr))

{

// Get a pointer to the buffer memory.

hr = pBuffer->Lock(&pData, NULL, NULL);

// Set this flag so that we're sure to unlock the buffer, even if

// the next call fails.

bBufferLocked = SUCCEEDED(hr);

}

// Fill the buffer

if (SUCCEEDED(hr))

{

hr = m_pSource->m_pByteStream->Read(pData, cbBuffer, &cbRead);

}

// Unlock the buffer.

if (bBufferLocked)

{

hr = pBuffer->Unlock();

}

// Set the size of the valid data in the buffer.

if (SUCCEEDED(hr))

{

hr = pBuffer->SetCurrentLength(cbRead);

}

// Create a new sample and add the buffer to it.

if (SUCCEEDED(hr))

{

hr = MFCreateSample(&pSample);

}

if (SUCCEEDED(hr))

{

hr = pSample->AddBuffer(pBuffer);

}

// Set the time stamps, duration, and sample flags.

if (SUCCEEDED(hr))

{

hr = pSample->SetSampleTime(m_rtCurrentPosition);

}

if (SUCCEEDED(hr))

{

hr = pSample->SetSampleDuration(duration);

}

if (SUCCEEDED(hr))

{

// Set the discontinuity flag.

if (m_discontinuity)

{

hr = pSample->SetUINT32(MFSampleExtension_Discontinuity, TRUE);

}

}

if (SUCCEEDED(hr))

{

// Update our current position.

m_rtCurrentPosition += duration;

// Give the pointer to the caller.

*ppSample = pSample;

(*ppSample)->AddRef();

}

SAFE_RELEASE(pBuffer);

SAFE_RELEASE(pSample);

return hr;

}





Re: Media Foundation Development uncompressed YUV to EVR

Tony1972

hi

hr = m_pSource->m_pByteStream->Read(pData, cbBuffer, &cbRead);

what is contained in m_pByteStream

one frame

sequence of frames

is file pointer at the right place

what is returned in cbRead





Re: Media Foundation Development uncompressed YUV to EVR

hashbrown

hi tony,

yes each is one frame of yuv data

i have confirmed this by printing out size of each sample..





Re: Media Foundation Development uncompressed YUV to EVR

Tony1972

no more ideas...

have a look at this

ftp://fido.tsc.ru/incoming/Vista/MF/Forum/2007-01-07.ZIP

that's my test samples

they definitely work for YUY2





Re: Media Foundation Development uncompressed YUV to EVR

hashbrown

thanks tony, ill check it out...but the ftp site you sent doesn't work, can you repost



Re: Media Foundation Development uncompressed YUV to EVR

Tony1972

strange...

try this link:

disk.tom.ru/282402 pw=CB38oqPF

or tell your ftp adress for upload





Re: Media Foundation Development uncompressed YUV to EVR

hashbrown

hi all

when copying a YUV sample from src to dest using MFCopyImage, for some reason it turns out to be greyscale even though though the original image has color. The UV bytes are not being set properly...anyone else have this issue