Changeset 637


Ignore:
Timestamp:
Jun 3, 2016, 2:02:51 PM (6 years ago)
Author:
roman
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/DirectShowReferenceSource/Sample/MfGenerate/Application.cpp

    r636 r637  
    5252                        CComPtr<IVideoMediaSource> pVideoMediaSource;
    5353                        __C(pVideoMediaSource.CoCreateInstance(__uuidof(VideoMediaSource)));
    54                         __C(pVideoMediaSource->SetMediaType(1280, 720, CComVariant(_PersistHelper::StringFromIdentifier(MEDIASUBTYPE_RGB32))));
     54                        __C(pVideoMediaSource->SetMediaType(4096, 2304, CComVariant(_PersistHelper::StringFromIdentifier(MEDIASUBTYPE_RGB32))));
    5555                        //__C(pVideoMediaSource->SetMediaTypeAspectRatio(...));
    5656                        __C(pVideoMediaSource->SetMediaTypeRate(50, 1));
    57                         __C(pVideoMediaSource->put_Duration(2.0));
     57                        __C(pVideoMediaSource->put_Duration(5.0));
    5858                        pMediaSource = pVideoMediaSource;
    5959                }
     
    7474                pWriterMediaType[MF_MT_MAJOR_TYPE] = MFMediaType_Video;
    7575                pWriterMediaType[MF_MT_SUBTYPE] = MFVideoFormat_H264;
    76                 pWriterMediaType[MF_MT_AVG_BITRATE] = (UINT32) (10 << 10) * 1000; // 10 MBps
     76                pWriterMediaType[MF_MT_AVG_BITRATE] = (UINT32) (12 << 10) * 1000; // 12 MBps
    7777                pWriterMediaType[MF_MT_FRAME_RATE] = pMediaType.GetUINT64(MF_MT_FRAME_RATE);
    7878                pWriterMediaType[MF_MT_FRAME_SIZE] = pMediaType.GetUINT64(MF_MT_FRAME_SIZE);
     
    8181                DWORD nWriterStreamIndex;
    8282                __C(pSinkWriter->AddStream(pWriterMediaType, &nWriterStreamIndex));
    83                 __C(pSinkWriter->SetInputMediaType(nWriterStreamIndex, pMediaType, NULL));
     83                // NOTE: Sink Writer Attributes https://msdn.microsoft.com/en-us/library/windows/desktop/dd389284
     84                {
     85                        MF::CAttributes pAttributes;
     86                        pAttributes.Create(10);
     87                        pAttributes[MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS] = (UINT32) 1;
     88                        __C(pSinkWriter->SetInputMediaType(nWriterStreamIndex, pMediaType, pAttributes));
     89                }
    8490                __C(pSinkWriter->BeginWriting());
    8591                for(; ; )
Note: See TracChangeset for help on using the changeset viewer.