当前位置: 首页>>代码示例>>C++>>正文


C++ CopyMediaType函数代码示例

本文整理汇总了C++中CopyMediaType函数的典型用法代码示例。如果您正苦于以下问题:C++ CopyMediaType函数的具体用法?C++ CopyMediaType怎么用?C++ CopyMediaType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CopyMediaType函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CopyMediaType

//
// CheckInputType
//
// Check the input type is OK - return an error otherwise
//
HRESULT CAudioTimeScale::CheckInputType(const CMediaType *mtIn)
{
    // check this is an audio format that we can support
    if (*mtIn->FormatType() != FORMAT_WaveFormatEx) {
        return E_INVALIDARG;
    }

    // Can we transform this type
    if (CanPerformTransform(mtIn)) {
		CopyMediaType(&m_mt, mtIn);
    	return NOERROR;
    }
    return E_FAIL;
}
开发者ID:guojerry,项目名称:cppxml,代码行数:19,代码来源:AudioTimeScale.cpp

示例2: FreeMediaType

STDMETHODIMP CapturePin::QueryAccept(const AM_MEDIA_TYPE *pmt)
{
    if(pmt->majortype != expectedMajorType)
        return S_FALSE;
    if(!IsValidMediaType(pmt))
        return S_FALSE;

    if(connectedPin)
    {
        FreeMediaType(connectedMediaType);
        CopyMediaType(&connectedMediaType, pmt);
    }

    return S_OK;
}
开发者ID:wwllww,项目名称:LiveStream_MultiIntance,代码行数:15,代码来源:CaptureFilter.cpp

示例3: lock

HRESULT CSampleSender::SetAcceptedMediaType( const CMediaType * pmt )
{
    CAutoLock lock( &m_Lock );

    if( !pmt )
    {
        m_mtAccept = CMediaType( );
        return NOERROR;        
    }

    HRESULT hr;
    hr = CopyMediaType( &m_mtAccept, pmt );

    return hr;
}
开发者ID:RaymondLiao,项目名称:elektronika,代码行数:15,代码来源:dxsend.cpp

示例4: CMediaSample_SetMediaType

/**
 * \brief IMediaType::SetMediaType (specifies media type for sample)
 *
 * \param[in] This pointer to CMediaSample object
 * \param[in] pMediaType pointer to AM_MEDIA_TYPE specifies new media type
 *
 * \return S_OK success
 * \return E_OUTOFMEMORY insufficient memory
 *
 */
static HRESULT STDCALL CMediaSample_SetMediaType(IMediaSample * This,
						 AM_MEDIA_TYPE *pMediaType)
{
    AM_MEDIA_TYPE* t;
    Debug printf("CMediaSample_SetMediaType(%p) called\n", This);
    if (!pMediaType)
	return E_INVALIDARG;
    t = &((CMediaSample*)This)->media_type;
    if(((CMediaSample*)This)->type_valid)
	FreeMediaType(t);
    CopyMediaType(t,pMediaType);
    ((CMediaSample*) This)->type_valid=1;

    return 0;
}
开发者ID:Gamer125,项目名称:wiibrowser,代码行数:25,代码来源:cmediasample.c

示例5: CreateMediaType

AM_MEDIA_TYPE * WINAPI CreateMediaType(AM_MEDIA_TYPE const * pSrc)
{
    AM_MEDIA_TYPE * pDest;

    pDest = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
    if (!pDest)
        return NULL;

    if (FAILED(CopyMediaType(pDest, pSrc)))
    {
        CoTaskMemFree(pDest);
        return NULL;
    }

    return pDest;
}
开发者ID:mvardan,项目名称:ros-svn-mirror,代码行数:16,代码来源:mediatype.c

示例6: CopyMediaType

HRESULT CBufferFilter::GetMediaType(int iPosition, CMediaType* pMediaType)
{
	if (m_pInput->IsConnected() == FALSE) {
		return E_UNEXPECTED;
	}

	// TODO: offer all input types from upstream and allow reconnection at least in stopped state
	if (iPosition < 0) {
		return E_INVALIDARG;
	}
	if (iPosition > 0) {
		return VFW_S_NO_MORE_ITEMS;
	}

	CopyMediaType(pMediaType, &m_pInput->CurrentMediaType());

	return S_OK;
}
开发者ID:WinnerSoftLab,项目名称:WinnerMediaPlayer,代码行数:18,代码来源:BufferFilter.cpp

示例7: CreateMediaType

AM_MEDIA_TYPE * WINAPI CreateMediaType(AM_MEDIA_TYPE const *pSrc)
{
    ASSERT(pSrc);

    // Allocate a block of memory for the media type

    AM_MEDIA_TYPE *pMediaType =
        (AM_MEDIA_TYPE *)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));

    if (pMediaType == NULL) {
        return NULL;
    }
    // Copy the variable length format block

    CopyMediaType(pMediaType,pSrc);

    return pMediaType;
}
开发者ID:DragonZX,项目名称:fdm2,代码行数:18,代码来源:mtype.cpp

示例8: StdMediaSample2_GetMediaType

static HRESULT WINAPI StdMediaSample2_GetMediaType(IMediaSample2 * iface, AM_MEDIA_TYPE ** ppMediaType)
{
    StdMediaSample2 *This = (StdMediaSample2 *)iface;

    TRACE("(%p)\n", ppMediaType);

    if (!This->props.pMediaType) {
        /* Make sure we return a NULL pointer (required by native Quartz dll) */
        if (ppMediaType)
            *ppMediaType = NULL;
        return S_FALSE;
    }

    if (!(*ppMediaType = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))))
        return E_OUTOFMEMORY;

    return CopyMediaType(*ppMediaType, This->props.pMediaType);
}
开发者ID:howard5888,项目名称:wineT,代码行数:18,代码来源:memallocator.c

示例9: VfwPin_GetMediaType

static HRESULT WINAPI VfwPin_GetMediaType(BasePin *pin, int iPosition, AM_MEDIA_TYPE *pmt)
{
    VfwPinImpl *This = impl_from_BasePin(pin);
    AM_MEDIA_TYPE *vfw_pmt;
    HRESULT hr;

    if (iPosition < 0)
        return E_INVALIDARG;
    if (iPosition > 0)
        return VFW_S_NO_MORE_ITEMS;

    hr = qcap_driver_get_format(This->parent->driver_info, &vfw_pmt);
    if (SUCCEEDED(hr)) {
        CopyMediaType(pmt, vfw_pmt);
        DeleteMediaType(vfw_pmt);
    }
    return hr;
}
开发者ID:AndreRH,项目名称:wine,代码行数:18,代码来源:vfwcapture.c

示例10: StdMediaSample2_SetMediaType

static HRESULT WINAPI StdMediaSample2_SetMediaType(IMediaSample2 * iface, AM_MEDIA_TYPE * pMediaType)
{
    StdMediaSample2 *This = impl_from_IMediaSample2(iface);

    TRACE("(%p)->(%p)\n", iface, pMediaType);

    if (This->props.pMediaType)
    {
        FreeMediaType(This->props.pMediaType);
        This->props.pMediaType = NULL;
    }
    if (!pMediaType)
        return S_FALSE;
    if (!(This->props.pMediaType = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))))
        return E_OUTOFMEMORY;

    return CopyMediaType(This->props.pMediaType, pMediaType);
}
开发者ID:RPG-7,项目名称:reactos,代码行数:18,代码来源:memallocator.c

示例11: CheckPointer

/* Return the media type of the connection */
STDMETHODIMP
CBasePin::ConnectionMediaType(
							  AM_MEDIA_TYPE *pmt
							  )
{
	CheckPointer(pmt,E_POINTER);
	ValidateReadWritePtr(pmt,sizeof(AM_MEDIA_TYPE));
	CComAutoLock cObjectLock(m_pLock);

	/*  Copy constructor of m_mt allocates the memory */
	if (IsConnected()) {
		CopyMediaType( pmt, &m_mt );
		return S_OK;
	} else {
		((CMediaType *)pmt)->InitMediaType();
		return VFW_E_NOT_CONNECTED;
	}
}
开发者ID:EnoroF,项目名称:easygamelibs,代码行数:19,代码来源:BasePin.cpp

示例12: CorrectMediaType

void CorrectMediaType(AM_MEDIA_TYPE* pmt)
{
	if(!pmt) return;

	CMediaType mt(*pmt);

	if(mt.formattype == FORMAT_VideoInfo)
	{
		VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)mt.pbFormat;

		for(int i = 0; i < VIHSIZE; i++)
		{
			if(mt.subtype == *vihs[i].subtype
			&& vih->bmiHeader.biCompression == vihs[i].vih.bmiHeader.biCompression)
			{
				mt.AllocFormatBuffer(vihs[i].size);
				memcpy(mt.pbFormat, &vihs[i], vihs[i].size);
				memcpy(mt.pbFormat, pmt->pbFormat, sizeof(VIDEOINFOHEADER));
				break;
			}
		}
	}
	else if(mt.formattype == FORMAT_VideoInfo2)
	{
		VIDEOINFOHEADER2* vih2 = (VIDEOINFOHEADER2*)mt.pbFormat;

		for(int i = 0; i < VIHSIZE; i++)
		{
			if(mt.subtype == *vih2s[i].subtype
			&& vih2->bmiHeader.biCompression == vih2s[i].vih.bmiHeader.biCompression)
			{
				mt.AllocFormatBuffer(vih2s[i].size);
				memcpy(mt.pbFormat, &vih2s[i], vih2s[i].size);
				memcpy(mt.pbFormat, pmt->pbFormat, sizeof(VIDEOINFOHEADER2));
				break;
			}
		}
	}

	CopyMediaType(pmt, &mt);
}
开发者ID:Cyberbeing,项目名称:xy-VSFilter,代码行数:41,代码来源:MediaTypes.cpp

示例13: CreateMediaType

AM_MEDIA_TYPE * WINAPI CreateMediaType(AM_MEDIA_TYPE const *pSrc)
{
    _ASSERT(pSrc);

    // Allocate a block of memory for the media type

    AM_MEDIA_TYPE *pMediaType =
        (AM_MEDIA_TYPE *)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));

    if (pMediaType == NULL) {
        return NULL;
    }
    // Copy the variable length format block

    HRESULT hr = CopyMediaType(pMediaType,pSrc);
    if (FAILED(hr)) {
        CoTaskMemFree((PVOID)pMediaType);
        return NULL;
    }

    return pMediaType;
}
开发者ID:shilinxu,项目名称:iprojects,代码行数:22,代码来源:dshowutil.cpp

示例14: EnumMediaTypes_Construct

HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType enumFunc, BasePin_GetMediaTypeVersion versionFunc, IEnumMediaTypes ** ppEnum)
{
    ULONG i;
    IEnumMediaTypesImpl * pEnumMediaTypes = CoTaskMemAlloc(sizeof(IEnumMediaTypesImpl));
    AM_MEDIA_TYPE amt;

    if (!pEnumMediaTypes)
    {
        *ppEnum = NULL;
        return E_OUTOFMEMORY;
    }
    pEnumMediaTypes->IEnumMediaTypes_iface.lpVtbl = &IEnumMediaTypesImpl_Vtbl;
    pEnumMediaTypes->refCount = 1;
    pEnumMediaTypes->uIndex = 0;
    pEnumMediaTypes->enumMediaFunction = enumFunc;
    pEnumMediaTypes->mediaVersionFunction = versionFunc;
    IPin_AddRef(&basePin->IPin_iface);
    pEnumMediaTypes->basePin = basePin;

    i = 0;
    while (enumFunc(basePin, i, &amt) == S_OK) i++;

    pEnumMediaTypes->enumMediaDetails.cMediaTypes = i;
    pEnumMediaTypes->enumMediaDetails.pMediaTypes = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE) * i);
    for (i = 0; i < pEnumMediaTypes->enumMediaDetails.cMediaTypes; i++)
    {
        enumFunc(basePin,i,&amt);
        if (FAILED(CopyMediaType(&pEnumMediaTypes->enumMediaDetails.pMediaTypes[i], &amt)))
        {
            while (i--)
                FreeMediaType(&pEnumMediaTypes->enumMediaDetails.pMediaTypes[i]);
            CoTaskMemFree(pEnumMediaTypes->enumMediaDetails.pMediaTypes);
            return E_OUTOFMEMORY;
        }
    }
    *ppEnum = &pEnumMediaTypes->IEnumMediaTypes_iface;
    pEnumMediaTypes->currentVersion = versionFunc(basePin);
    return S_OK;
}
开发者ID:AlexSteel,项目名称:wine,代码行数:39,代码来源:mediatype.c

示例15: CopyMediaType

HRESULT CDeCSSFilter::GetMediaType(int iPosition, CMediaType* pmt)
{
    if (m_pInput->IsConnected() == FALSE) {
        return E_UNEXPECTED;
    }

    if (iPosition < 0) {
        return E_INVALIDARG;
    }
    if (iPosition > 1) {
        return VFW_S_NO_MORE_ITEMS;
    }

    CopyMediaType(pmt, &m_pInput->CurrentMediaType());
    if (iPosition == 0) {
        pmt->majortype = MEDIATYPE_MPEG2_PACK;
    }
    if (iPosition == 1) {
        pmt->majortype = MEDIATYPE_MPEG2_PES;
    }

    return S_OK;
}
开发者ID:AeonAxan,项目名称:mpc-hc,代码行数:23,代码来源:DeCSSFilter.cpp


注:本文中的CopyMediaType函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。