- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Help! Anyone sucessfully use the example simpleplayer to execute in WM5. Simpleplayer can not play video.
I debug the smaple and found the default video render MTWREGVideoRender can not be initilized because the following code error: can not find register valuse "LCDDriver".
if (UMC_OK == umcRes &&
ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE,
VM_STRING("LCDDriver"),
0,
KEY_QUERY_VALUE,
&hKey))
{
umcRes = UMC_OPERATION_FAILED;
}
DWORD dwBufSize = sizeof(m_pvVideoMemPtr);
if (UMC_OK == umcRes &&
ERROR_SUCCESS != RegQueryValueEx(hKey,
VM_STRING("BaseFrameAddr"),
NULL,
NULL,
(LPBYTE)&m_pvVideoMemPtr,
&dwBufSize))
{
umcRes = UMC_OPERATION_FAILED;
}
Please help me.
I also write another source code refer to UMC manual,but umcRes always eaqule to UMC::UMC_NOT_ENOUGH_DATA when decoding. The data can not be sent to video render.Please help me.
#include "stdafx.h"
#include
#include
#include
#include
#include "ippdefs.h"
#include "ippcore.h"
#include "ipps.h"
#include "ippi.h"
#include "ippj.h"
#include "ippcc.h"
#include "umc_defs.h"
#include "vm_time.h"
#include "umc_structures.h"
#include "umc_data_reader.h"
#include "umc_splitter.h"
#include "umc_splitter_ex.h"
#include "umc_video_decoder.h"
#include "umc_video_data.h"
#include "umc_video_render.h"
#include "umc_file_reader.h"
#include "umc_fio_reader.h"
#include "umc_cyclic_buffer.h"
#include "umc_self_destruction_pointer.h"
#include "umc_h264_dec.h"
#include "umc_mpeg2_spl.h"
#include "umc_mjpeg_video_decoder.h"
#include "umc_color_space_converter.h"
#include "fw_video_render.h"
static void copyright(void)
{
printf("
Intel Media processing sample based on
");
printf(" UMC and Intel Integrated Performance Primitives
");
printf("Copyright(c) 2005 Intel Corporation. All Rights Reserved.
");
return;
} // copyright()
static void ipp_version(void)
{
const IppLibraryVersion* version;
printf("Intel Integrated Performance Primitives
");
/* ippCore version info */
version = ippGetLibVersion();
printf(" %s, %s {%d.%d.%d.%d}, build date %s
",
version->Name,
version->Version,
version->major,version->minor,version->majorBuild,version->build,
version->BuildDate);
/* ippSP version info */
version = ippsGetLibVersion();
printf(" %s, %s {%d.%d.%d.%d}, build date %s
",
version->Name,
version->Version,
version->major,version->minor,version->majorBuild,version->build,
version->BuildDate);
/* ippIP version info */
version = ippiGetLibVersion();
printf(" %s, %s {%d.%d.%d.%d}, build date %s
",
version->Name,
version->Version,
version->major,version->minor,version->majorBuild,version->build,
version->BuildDate);
/* ippJP version info */
version = ippjGetLibVersion();
printf(" %s, %s {%d.%d.%d.%d}, build date %s
",
version->Name,
version->Version,
version->major,version->minor,version->majorBuild,version->build,
version->BuildDate);
/* ippCC version info */
version = ippccGetLibVersion();
printf(" %s, %s {%d.%d.%d.%d}, build date %s
",
version->Name,
version->Version,
version->major,version->minor,version->majorBuild,version->build,
version->BuildDate);
printf("
");
return;
} // ipp_version()
static vm_char* VideoStreamTypeStr(UMC::VideoStreamType vtype)
{
vm_char* str;
switch(vtype)
{
case UMC::UNDEF_VIDEO: str = VM_STRING("undefined"); break;
case UMC::UNCOMPRESSED_VIDEO: str = VM_STRING("uncompressed"); break;
case UMC::MPEG1_VIDEO: str = VM_STRING("MPEG1"); break;
case UMC::MPEG2_VIDEO: str = VM_STRING("MPEG2"); break;
case UMC::MPEG4_VIDEO: str = VM_STRING("MPEG4"); break;
case UMC::H261_VIDEO: str = VM_STRING("H.261"); break;
case UMC::H263_VIDEO: str = VM_STRING("H.263"); break;
case UMC::H264_VIDEO: str = VM_STRING("H.264"); break;
case UMC::DIGITAL_VIDEO_SD: str = VM_STRING("DV_SD"); break;
case UMC::DIGITAL_VIDEO_50: str = VM_STRING("DV_50"); break;
case UMC::DIGITAL_VIDEO_HD: str = VM_STRING("DV_HD"); break;
case UMC::WMV_VIDEO: str = VM_STRING("WMV"); break;
case UMC::MJPEG_VIDEO: str = VM_STRING("MJPEG"); break;
default: str = VM_STRING("unknown"); break;
}
return str;
} // VideoStreamTypeStr()
static vm_char* ColorFormatStr(UMC::ColorFormat color)
{
vm_char* str;
switch(color)
{
case UMC::YV12: str = VM_STRING("YV12"); break;
case UMC::NV12: str = VM_STRING("NV12"); break;
case UMC::YUY2: str = VM_STRING("YUY2"); break;
case UMC::UYVY: str = VM_STRING("UYVY"); break;
case UMC::YUV411: str = VM_STRING("YUV411"); break;
case UMC::YUV420: str = VM_STRING("YUV420"); break;
case UMC::YUV422: str = VM_STRING("YUV422"); break;
case UMC::YUV444: str = VM_STRING("YUV444"); break;
case UMC::YUV420M: str = VM_STRING("YUV420M"); break;
case UMC::YUV422M: str = VM_STRING("YUV422M"); break;
case UMC::YUV444M: str = VM_STRING("YUV444M"); break;
case UMC::RGB32: str = VM_STRING("RGB32"); break;
case UMC::RGB24: str = VM_STRING("RGB24"); break;
case UMC::RGB565: str = VM_STRING("RGB565"); break;
case UMC::RGB555: str = VM_STRING("RGB555"); break;
case UMC::RGB444: str = VM_STRING("RGB444"); break;
case UMC::NONE:
default: str = VM_STRING("unknown"); break;
}
return str;
} // ColorFormatStr()
UMC::Status InitDataReader(UMC::DataReader* pDataReader,vm_char* file_name)
{
UMC::FileReaderParams FileParams;
FileParams.m_portion_size = 0;
vm_string_strcpy(FileParams.m_file_name, file_name);
return pDataReader->Init(&FileParams);
} // InitDataReader()
UMC::Status InitVideoSplitter(UMC::Splitter* pAVISplitter,UMC::DataReader* pDataReader,UMC::MediaDataEx &FirstFrameV)
{
UMC::Status umcSts;
UMC::SystemStreamType type = UMC::Splitter::GetStreamType(pDataReader);
UMC::SelfDestructionObject<:SPLITTERPARAMS> lpSplParams;
UMC::MpegSplitterParams *spl_params;
lpSplParams = spl_params = new UMC::MpegSplitterParams();
if (0 == lpSplParams)
{ umcSts = UMC::UMC_ALLOC; }
else
{ spl_params->m_mediaData = &FirstFrameV; }
spl_params->m_lFlags = UMC::FLAG_VSPL_VIDEO_HEADER_REQ|UMC::FLAG_VSPL_COMPATIBLE|UMC::VIDEO_SPLITTER;// exctract only video
spl_params->m_pDataReader = pDataReader;
spl_params->m_mediaData = &FirstFrameV;
return pAVISplitter->Init(*spl_params);
} // InitAVISplitter()
UMC::Status InitMJPEGVideoDecoder(UMC::VideoDecoder* pVideoDecoder,UMC::ColorSpaceConverter* pColorSpaceConverter,UMC::VideoStreamInfo* video_info,UMC::MediaDataEx &rFirstFrame)
{
//if (video_info->stream_type != UMC::MJPEG_VIDEO)
//return UMC::UMC_OPERATION_FAILED;
UMC::ColorConversionInfo ColorInit;
ColorInit.SizeSource.width = video_i
nfo->clip_info.width;
ColorInit.SizeSource.height = video_info->clip_info.height;
vm_var32 uiFactor = 1;
ColorInit.FormatDest = UMC::YV12;
ColorInit.SizeDest.width = video_info->clip_info.width;
ColorInit.SizeDest.height = video_info->clip_info.height;
ColorInit.lFlags = 1;
ColorInit.lDeinterlace = 0;
ColorInit.lInterpolation = UMC::FLAG_CCNV_CONVERT;
UMC::VideoDecoderParams VDecParams;
VDecParams.info = *video_info;
VDecParams.cformat = UMC::YV12;
VDecParams.lFlags = 0;
VDecParams.lpConverter = pColorSpaceConverter;
VDecParams.lpConvertInit = &ColorInit;
VDecParams.uiLimitThreads = 1;
VDecParams.m_pData = &rFirstFrame;
return pVideoDecoder->Init(&VDecParams);
} // InitMJPEGVideoDecoder()
UMC::Status InitVideoRender(UMC::VideoRender* pVideoRender,UMC::VideoStreamInfo* video_info)
{
UMC::VideoRenderParams video_params;
video_params.color_format = video_info->color_format;
video_params.info = video_info->clip_info;
return pVideoRender->Init(&video_params);
} // InitVideoRender()
UMC::Status DecodeMJPEGVideo(vm_char* input_file)
{
int nframes;
vm_tick t0;
vm_tick t1;
vm_tick total;
vm_tick freq;
double fps;
UMC::Status umcRes;
UMC::FileReader *src;
src = new UMC::FileReader();
UMC::MPEG2Splitter *mpg_spl;
mpg_spl = new UMC::MPEG2Splitter();
UMC::SplitterInfo spl_info;
UMC::H264VideoDecoder *mjpeg_dec;
mjpeg_dec = new UMC::H264VideoDecoder();
UMC::ColorSpaceConverter cc;
UMC::FWVideoRender dst;
UMC::MediaData in;
UMC::VideoData out;
UMC::MediaDataEx FirstFrameV;
// Initialize data reader component
UMC::SystemStreamType sys_type;
umcRes = InitDataReader(src,input_file);
if (umcRes != UMC::UMC_OK)
return umcRes;
// Initialize splitter component
umcRes = InitVideoSplitter(mpg_spl, src,FirstFrameV);
if (umcRes != UMC::UMC_OK)
return umcRes;
// get stream info
//m_pSplitter = &mpg_spl;
umcRes = mpg_spl->GetInfo(&spl_info);
if (umcRes != UMC::UMC_OK)
return umcRes;
_tprintf(_T("file: %s
"),input_file);
_tprintf(_T(" video stream
"));
_tprintf(_T(" type :%s
"),VideoStreamTypeStr(spl_info.m_video_info.stream_type));
_tprintf(_T(" dims :%dx%d
"),spl_info.m_video_info.clip_info.width,spl_info.m_video_info.clip_info.height);
_tprintf(_T(" color : %s
"),ColorFormatStr(spl_info.m_video_info.color_format));
// Initialize video decoder component
umcRes = mpg_spl->GetNextVideoData(&in);
if (umcRes != UMC::UMC_OK)
return umcRes;
umcRes = InitMJPEGVideoDecoder(mjpeg_dec, &cc,&spl_info.m_video_info,FirstFrameV);
if (umcRes != UMC::UMC_OK)
return umcRes;
// Initialize video render component
umcRes = InitVideoRender(&dst, &spl_info.m_video_info);
if (umcRes != UMC::UMC_OK)
return umcRes;<
BR>freq = vm_time_get_frequency();
total = 0;
nframes = 0;
// decoding & rendering loop (frame by frame)
while(umcRes == UMC::UMC_OK || umcRes == UMC::UMC_NOT_ENOUGH_DATA)
{
umcRes = mpg_spl->GetNextVideoData(&in);
if (umcRes != UMC::UMC_OK)
break;
umcRes = dst.LockInputBuffer(&out);
if (umcRes != UMC::UMC_OK)
break;
t0 = vm_time_get_tick();
umcRes = mjpeg_dec->GetFrame(&in, &out);
if (umcRes != UMC::UMC_OK && umcRes != UMC::UMC_NOT_ENOUGH_DATA)
break;
t1 = vm_time_get_tick();
total += (t1 - t0);
printf("frame# %d, FPS - %4.1f
",nframes, (double)1.0 / ((t1 - t0) /
(double)freq));
if(umcRes == UMC::UMC_OK)
{
umcRes = dst.UnLockInputBuffer(&out);
if (umcRes != UMC::UMC_OK)
break;
double time = dst.GetRenderFrame();
umcRes = dst.RenderFrame();
if (umcRes != UMC::UMC_OK)
break;
}
nframes++;
} // while()
fps = (double)(freq / ((double)total / nframes));
printf("processed %d frames, with avg performance %4.1f FPS
",nframes, fps);
return umcRes;
} // DecodeMJPEGVideo()
int _tmain(int argc, _TCHAR* argv[])
{
IppStatus s = ippStaticInit();
copyright();
ipp_version();
DecodeMJPEGVideo(_T("\clip1.mpg"));
} // main()
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, for the simple_player: there are several video renders (including rendering to file instead of screen), please refer to simple_player readme.htm file for the details on available command line options.
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,Vladimir
I wrote a simple player to play h.264 file on WM5 with IPP. The exaple could be executed which complied with embedded visual c++ sp4 ,but the same exaple can not be executed whch compiled with visual studio 2005. The Unhandled exception is on ippiInterpolateLuma_H264_8u_C1R.So I thought ipp maybe do not support visual studio 2005 complier. Please help me to solve the problem.Hope you can make sure whether IPP IXP library support visual studio 2005. Thank you. Please reply me as soon as possible!
Regards,
Chen Kai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Chen Kai
if Windows Mobile 5/VC2005 was not listed in IPP release notes as a supported OS/ tools that means that we do not test IPP in that environment, which by itself, not necessary means that IPP will not work in that environment. But that mean that we do not quarantee that it will work here.
Regards,
Vladimir

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page