Search for posts tagged with: mobile

Avatar

具体请看附件..

errornumber

类似

(0, “S_OK”, “The function completed successfully”)
(0×1, “S_FALSE”, “Call successful, but returned FALSE”)
(0×2, “DXERROR_FILE_NOT_FOUND”, “The system cannot find the file specified.”)
(0×3, “DXERROR_PATH_NOT_FOUND”, “The system cannot find the path specified.”)
(0×4, “DXERROR_TOO_MANY_OPEN_FILES”, “The system cannot open the file.”)
(0×5, “DXERROR_ACCESS_DENIED”, “Access is denied.”)
(0×6, “DXERROR_INVALID_HANDLE”, “The handle is invalid.”)
(0×8, “DXERROR_NOT_ENOUGH_MEMORY”, “Not enough storage is available to process this command.”)
(0×9, “DXERROR_INVALID_BLOCK”, “The storage control block address is invalid.”)
(0xa, “DXERROR_BAD_ENVIRONMENT”, “The environment is incorrect.”)
(0xb, “DXERROR_BAD_FORMAT”, “An attempt was made to load a program with an incorrect format.”)
(0xe, “DXERROR_OUTOFMEMORY”, “The system cannot find the drive specified.”)
(0×40003, “Unknown”, “End of stream. Sample not updated.”)
(0×40103, “VFW_S_NO_MORE_ITEMS”, “The end of the list has been reached.”)
(0×4022d, “VFW_S_DUPLICATE_NAME”, “An attempt to add a filter with a duplicate name succeeded with a modified name.”)
(0×40237, “VFW_S_STATE_INTERMEDIATE”, “The state transition has not completed.”)
(0×40242, “VFW_S_PARTIAL_RENDER”, “Some of the streams in this movie are in an unsupported format.”)
(0×40245, “VFW_S_SOME_DATA_IGNORED”, “The file contained some property settings that were not used.”)
(0×40246, “VFW_S_CONNECTIONS_DEFERRED”, “Some connections have failed and have been deferred.”)
(0×40250, “VFW_S_RESOURCE_NOT_NEEDED”, “The resource specified is no longer needed.”)
(0×40254, “VFW_S_MEDIA_TYPE_IGNORED”, “A connection could not be made with the media type in the persistent graph, but has been made with a negotiated media type.”)
(0×40257, “VFW_S_VIDEO_NOT_RENDERED”, “Cannot play back the video stream: no suitable decompressor could be found.”)
(0×40258, “VFW_S_AUDIO_NOT_RENDERED”, “Cannot play back the audio stream: no audio hardware is available.”)
(0×4025a, “VFW_S_RPZA”, “Cannot play back the video stream: format ‘RPZA’ is not supported.”)
(0×40260, “VFW_S_ESTIMATED”, “The value returned had to be estimated.  It’s accuracy can not be guaranteed.”)
(0×40263, “VFW_S_RESERVED”, “This success code is reserved for internal purposes within ActiveMovie.”)
(0×40267, “VFW_S_STREAM_OFF”, “The stream has been turned off.”)
(0×40268, “VFW_S_CANT_CUE”, “The graph can’t be cued because of lack of or corrupt data.”)
(0×40270, “VFW_S_NO_STOP_TIME”, “The stop time for the sample was not set.”)
(0×4027e, “VFW_S_NOPREVIEWPIN”, “There was no preview pin available, so the capture pin output is being split to provide both capture and preview.”)
(0×40280, “VFW_S_DVD_NON_ONE_SEQUENTIAL”, “The current title was not a sequential set of chapters (PGC) and the returned timing information might not be continuous.”)
(0×4028c, “VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE”, “The audio stream did not contain sufficient information to determine the contents of each channel.”)
(0×4028d, “VFW_S_DVD_NOT_ACCURATE”, “The seek into the movie was not frame accurate.”)
(0×150005, “DV_FULLDUPLEX”, “Full duplex”)
(0×15000a, “DV_HALFDUPLEX”, “Half duplex”)
(0×150010, “DV_PENDING”, “Pending”)
(0×876086f, “D3DOK_NOAUTOGEN”, “The call succeeded but there won’t be any mipmaps generated”)
(0×878000a, “DS_NO_VIRTUALIZATION”, “The call succeeded, but we had to substitute the 3D algorithm”)
DXERROR8(0×8780014, “DS_INCOMPLETE”, “The call succeeded, but not all of the optional effects were obtained.”)
(0×8781091, “DMUS_S_PARTIALLOAD”, “The object could only load partially. This can happen if some components are not registered properly, such as embedded tracks and tools. This can also happen if some content is missing. For example, if a segment uses a DLS collection that is not in the loader’s current search directory.”)
(0×8781092, “DMUS_S_PARTIALDOWNLOAD”, “Return value from IDirectMusicBand::Download() which indicates that some of the instruments safely downloaded, but others failed. This usually occurs when some instruments are on PChannels not supported by the performance or port.”)
(0×8781200, “DMUS_S_REQUEUE”, “Return value from IDirectMusicTool::ProcessPMsg() which indicates to the performance that it should cue the PMsg again automatically.”)
(0×8781201, “DMUS_S_FREE”, “Return value from IDirectMusicTool::ProcessPMsg() which indicates to the performance that it should free the PMsg automatically.”)
(0×8781202, “DMUS_S_END”, “Return value from IDirectMusicTrack::Play() which indicates to the segment that the track has no more data after mtEnd.”)
(0×8781210, “DMUS_S_STRING_TRUNCATED”, “Returned string has been truncated to fit the buffer size.”)
(0×8781211, “DMUS_S_LAST_TOOL”, “Returned from IDirectMusicGraph::StampPMsg() this indicates that the PMsg is already stamped with the last tool in the graph. The returned PMsg’s tool pointer is now NULL.”)
(0×8781212, “DMUS_S_OVER_CHORD”, “Returned from IDirectMusicPerformance::MusicToMIDI() this indicates  that no note has been calculated because the music value has the note  at a position higher than the top note of the chord. This applies only to DMUS_PLAYMODE_NORMALCHORD play mode. This success code indicates that the caller should not do anything with the note. It is not meant to be played against this chord.”)
(0×8781213, “DMUS_S_UP_OCTAVE”, “Returned from IDirectMusicPerformance::MIDIToMusic()  and IDirectMusicPerformance::MusicToMIDI() this indicates  that the note conversion generated a note value that is below 0,  so it has been bumped up one or more octaves to be in the proper MIDI range of 0 through 127.  Note that this is valid for MIDIToMusic() when using play modes DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of which store MIDI values in wMusicValue. With MusicToMIDI() it is valid for all play modes. Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.”)
(0×8781214, “DMUS_S_DOWN_OCTAVE”, “Returned from IDirectMusicPerformance::MIDIToMusic()  and IDirectMusicPerformance::MusicToMIDI() this indicates  that the note conversion generated a note value that is above 127, so it has been bumped down one or more octaves to be in the proper MIDI range of 0 through 127.  Note that this is valid for MIDIToMusic() when using play modes DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of which store MIDI values in wMusicValue. With MusicToMIDI() it is valid for all play modes. Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.”)
(0×8781215, “DMUS_S_NOBUFFERCONTROL”, “Although the audio output from the port will be routed to the same device as the given DirectSound buffer, buffer controls such as pan and volume will not affect the output.”)
(0×8781216, “DMUS_S_GARBAGE_COLLECTED”, “The requested operation was not performed because during CollectGarbage the loader determined that the object had been released.”)
(0×8000000a, “E_PENDING”, “The data necessary to complete this operation is not yet available.”)
(0×80004001, “E_NOTIMPL”, “The function called is not supported at this time”)
(0×80004002, “E_NOINTERFACE”, “The requested COM interface is not available”)
(0×80004003, “E_POINTER”, “Invalid pointer”)
(0×80004004, “E_ABORT”, “Operation aborted”)
(0×80004005, “E_FAIL”, “An undetermined error occurred”)
(0×8000ffff, “E_UNEXPECTED”, “Catastrophic failure”)

Tagged with: .
Avatar

所有内容是根据http://blog.csdn.net/moonsunearth/archive/2007/09/25/1800790.aspx整理得来的。

首先Windows mobile自带的camera程序是不支持双camera的,如果要加入双camera一个方法是在原来的程序中插入一个菜单来实现调用(经验证菜单的加入是可以实现的),另一个比较推荐的做法是使用directshow自己写一个camera程序。

切换的关键部分是通过directshow控制camera,然后驱动对切换消息进行响应,切换sensor。

Directshow对camera控制的接口如下:

LRESULT hr;

     CComPtr<IAMCameraControl> pCameraControl;

long lCurrentVal,lCurrentFlags;

long CameraControl_Switch=CameraControl_Flash+0xff;

if(sensor>=SENSOR_MAX)
return FALSE;

     CHK(m_pVideoCapFilter->QueryInterface(&pCameraControl));

     CHK(pCameraControl->Get(CameraControl_Switch, &lCurrentVal, &lCurrentFlags));
if(lCurrentVal == sensor)
…{
//return TRUE;
     }
   CHK(pCameraControl->Set(CameraControl_Switch, sensor, CameraControl_Flags_Manual));

IAMCameraControl::Set函数会调用CAM_IOControl,Ioctl=IOCTL_CS_PROPERTY这个是让驱动进行响应的关键。

在CAM_IOControl函数中对应的IOCTL_CS_PROPERTY中的部分是

else if ( TRUE == IsEqualGUID( pCsProp->Set, PROPSETID_VIDCAP_CAMERACONTROL ) )

{

dwErr = pCamDevice->AdapterHandleCamControlRequests( pInBuf,InBufLen, pOutBuf, OutBufLen, pdwBytesTransferred );

}

对于我们代码的添加一个是在这里添加一个自己的customer函数,另一个方法是继续向上层走,然后在上层添加自己的函数。不过因为这里是mdd层,所以最好不要修改,放到pdd层。

整个的流程的修改基本上就是这么多了。

在驱动层需要实现不同camera sensor的切换,然后上层通过directshow的IAMStreamConfig实现。

CComPtr<IAMStreamConfig> pStremConfig;

    CHK(m_pCapGraphBuilder->FindInterface(&PIN_CATEGORY_CAPTURE, 0, m_pVideoCapFilter, IID_IAMStreamConfig, (void **)&pStremConfig))

    CHK(pStremConfig->GetNumberOfCapabilities(&iCount, &iSize));

if (iSize == sizeof(VIDEO_STREAM_CONFIG_CAPS))
…{
for (int iFormat = 0; iFormat < iCount; iFormat++)
…{
            VIDEO_STREAM_CONFIG_CAPS scc;
            AM_MEDIA_TYPE *pmtConfig;

CHK(pStremConfig->GetStreamCaps(iFormat, &pmtConfig, (BYTE*)&scc));
if (SUCCEEDED(hr))
…{
if(scc.MinOutputSize.cx == pSize->cx && scc.MinOutputSize.cy == pSize->cy)
…{
                    CHK(pStremConfig->SetFormat(pmtConfig));
                    DeleteMediaType(pmtConfig);
break;
                }
                DeleteMediaType(pmtConfig);
            }
        }
    }

Tagged with: .