Dear Jack,
Last week, I corrected some mistakes.Something happened as following.
I take the YUV422 buffer as a.yuv and take YUV420 buffer converted
from YUV422 as b.yuv  in CameraHal.cpp .
And they can be displayed in YUVViewer, but their colors are not
normal. a.yuv is more redder than normal, and b.yuv is gray.
The "Invalid data type or size" disappeared in the log.
But the 3gp file encorded is still wrong, its playing only continued
for one or two seconds although I recorded for more than 30 seconds.
And the  picture of playing is full of colorful fragments.
Now, I have no ideas about this.
Do you have more suggestions? Or, could you attach your CameraHal.cpp?
Thank you very much for your help!


On 7月21日, 下午4时17分, Jack <zhang.sheng...@zte.com.cn> wrote:
> I did not meet the same problem. But I think maybe you can check the
> problem step by step and finally locate it to the cause root.
> 1. ensure the data transfer back from your hardware can construct the
> right format frame, e.g YUV422.
> 2. after the conversion, ensure the data transfer from CameraHAL to PV
> can construct the right format frame, e.g YUV420.
> In order to check these two things, you need to save one frame to
> a .yuv file in the CameraHAL.cpp and the
> pvmf_media_input_data_buffer.cpp separately.
> Write the save_to_file function by your self and add it in the two
> files above.
> Then check the two yuv file on PC, using some software like YUVViewer.
> If you can see two good pictures, that means you are not far from
> success.
> Good luck!
>
> On 7月21日, 下午3时17分, Tony <xingxin19860...@gmail.com> wrote:
>
>
>
> > I have used CC library to convert YUV422 to YUV420
> > as following:
>
> > get Next FrameAsYuv422(cc);
> > mYUV422toYUV420->Init(352,288,0,352,288,0,0);
> > mYUV422toYUV420->Convert(cc, (uint8_t*)buffer);
>
> > and I send the buffer to PV encoder.
> > But it stop video recording just when i start it.
> > Is the conversion method right?
>
> > the log as following:
>
> > E/CameraInput( 1438): writeComplete
> > E/CameraHardwareStub( 1438): >virtual void
> > android::CameraHardwareStub::releaseRecordingFrame(const
> > android::sp<android::IMemory>&)
> > E/CameraHardwareStub( 1438): <virtual void
> > android::CameraHardwareStub::releaseRecordingFrame(const
> > android::sp<android::IMemory>&)
> > E/PV      ( 1438): PVLOG:TID
> > (0x8062170):Time=4232:PVMFVideoEncPort::Run
> > E/PV      ( 1438): PVLOG:TID(0x8062170):Time=4232:0x8073db8
> > PvmfPortBaseImpl::Send
> > E/PV      ( 1438): PVLOG:TID(0x8062170):Time=4233:0x8074010
> > PvmfPortBaseImpl::Receive
> > E/PV      ( 1438): PVLOG:TID(0x8062170):Time=4233:PORT PVMP4ComposerIn
> > In Msg Received  MediaData SeqNum0, SId0, TS0, Q-depth 1/10
> > E/PV      ( 1438): PVLOG:TID
> > (0x8062170):Time=4233:PVMp4FFComposerPort::HandlePortActivity: type=5
> > E/PV      ( 1438): PVLOG:TID(0x8062170):Time=4233:PORT PVVideoEncOut
> > Msg Sent MediaData SeqNum0, SId0, TS0, Q-depth0/10
> > E/PV      ( 1438): PVLOG:TID
> > (0x8062170):Time=4233:PVMp4FFComposerPort::Run
> > E/PV      ( 1438): PVLOG:TID
> > (0x8062170):Time=4233:PVMp4FFComposerNode::ProcessIncomingMsg:
> > aPort=0x8074010
> > E/PV      ( 1438): PVLOG:TID(0x8062170):Time=4233:0x8074010
> > PvmfPortBaseImpl::DequeueIncomingMsg
> > E/PV      ( 1438): PVLOG:TID(0x8062170):Time=4233:PORT PVMP4ComposerIn
> > In Msg De-Q'd MediaData SeqNum0, SId0, TS0, Q-depth0/10
> > E/PV      ( 1438): PVLOG:TID
> > (0x8062170):Time=4233:PVMp4FFComposerNode::AddMemFragToTrack:
> > aFormat=0x259, aTimestamp=0, aTrackId=3
> > E/OpenCore( 1438): Tony, size =0, data =
> > E/PV      ( 1438): PVLOG:TID
> > (0x8062170):Time=4233:PVMp4FFComposerNode::AddMemFragToTrack: Error -
> > Invalid data or data size
> > E/PV      ( 1438): PVLOG:TID
> > (0x8062170):Time=4233:PVMp4FFComposerNode:ReportErrorEvent:
> > aEventType=8193, aEventData=0x8074010
> > E/PV      ( 1438): PVLOG:TID
> > (0x8062170):Time=4233:PVAuthorEngine::HandleNodeErrorEvent
> > E/PV      ( 1438): PVLOG:TID
> > (0x8062170):Time=4233:PVAuthorEngine::SetPVAEState: aState=5
> > E/AuthorDriver( 1438): HandleErrorEvent(-16)
> > E/MediaRecorder( 1816): message received msg=1, ext1=1, ext2=-16
> > E/MediaRecorder( 1816): callback application
> > E/MediaRecorder( 1816): back from callback
> > E/PV      ( 1438): PVLOG:TID
> > (0x8062170):Time=4234:PVMp4FFComposerPort::Run: Error -
> > ProcessIncomingMsg failed. status=-1
> > V/videocamera( 1816): stopVideoRecording
>
> > It still get the invalid data or data size.
>
> > Did you meet the same problem?
> > Thank you very much!
>
> > On 7月21日, 上午9时46分, Tony <xingxin19860...@gmail.com> wrote:
>
> > > I will try my best to achive today!
> > > Thanks a lot!
>
> > > On 7月21日, 上午9时20分, Jack <zhang.sheng...@zte.com.cn> wrote:
>
> > > > I sent YUV420 format to PV encoder, and I used the  colorconversion
> > > > (CC) library to achieve this. For more detail, you may read the files
> > > > inhttp://android.git.kernel.org/?p=platform/external/opencore.git;a=tre...
> > > > And I was helped by Ravi, he's an expert engineer in PV company, which
> > > > develops the PV framework. He helped me a lot in my process to develop
> > > > the application.
> > > > Here is his reply about the 
> > > > question:http://groups.google.com/group/android-framework/browse_thread/thread...
>
> > > > About the other question, I thinkthereare different ways to achive
> > > > the same goal, you may call mRecordingCallback
> > > > in previewThread()  or add another thead() (like recordingThead())to
> > > > call it. All the means could have advantages and disadvantages.
>
> > > > On 7月20日, 下午8时07分, Tony <xingxin19860...@gmail.com> wrote:
>
> > > > > Dear Jack,
> > > > > Thanks for your reply.
> > > > > I saw this two hours ago. I confirm I meet the same problem as you.
> > > > > And I tried to convert RGB565 to RGB24, but failed.
> > > > > Maybe it's related to my algorithm. What data type do you send to
> > > > > encoder? RGB12, RGB24 or YUV420? Different types means different
> > > > > difficulties, I think.
> > > > > I have to go home now and I will go on studying this part tomorrow.
> > > > > Another question, do you call mRecordingCallback in previewThread() in
> > > > > Camerahal.cpp?
> > > > > Thanks very much for your help.
>
> > > > > On 7月20日, 下午12时25分, Jack <zhang.sheng...@zte.com.cn> wrote:
>
> > > > > > Dear xin xing:
> > > > > > I am sorry that I can not use MSN or reply to you by email because 
> > > > > > of
> > > > > > my working place's rule.
> > > > > > So may be we could talk just in this way--on the group. In the file
> > > > > > Pvm4vencoder.cpp, you may find
> > > > > > the format that cupcake_r1 supports encoding now.Thereare only 3
> > > > > > types including YUV420, rgb12,and rgb24.
> > > > > > So, convert your video frame format into these 3 types before you 
> > > > > > send
> > > > > > them to the encoder or just add your own function to the framework 
> > > > > > may
> > > > > > lead you forward.
> > > > > > I recommend the former one. Wish it can help.
>
> > > > > > On 7月18日, 下午2时16分, Jack <zhang.sheng...@zte.com.cn> wrote:
>
> > > > > > > Thank you Ravi, I now can record the video and play it in the 
> > > > > > > correct
> > > > > > > way.
> > > > > > > Thank you very much for your help!
>
> > > > > > > On 7月10日, 下午9时58分, RaviY <yend...@pv.com> wrote:
>
> > > > > > > > pvmi/pvmf/include/pvmf_return_codes.h
>
> > > > > > > > On Jul 10, 3:21 am, Jack <zhang.sheng...@zte.com.cn> wrote:
>
> > > > > > > > > Hi,Ravi
> > > > > > > > > I tried to fill the functions by myself but still can't fix 
> > > > > > > > > it. Now I
> > > > > > > > > can enter the preview mode of video recorder, but the 
> > > > > > > > > function got
> > > > > > > > > crushed every time I press the start key.
> > > > > > > > > And I got the log below:
>
> > > > > > > > > ......
> > > > > > > > > D/CameraService(   55): startCameraMode(1)
> > > > > > > > > D/CameraHardware(   55): CameraHardware startRecording:
> > > > > > > > > D/CameraHardware(   55): vendor/marvell/marvell_310/libcamera/
> > > > > > > > > CameraHardware.cpp startRecording 761
> > > > > > > > > E/PVAE    (   55): 
> > > > > > > > > PVAuthorEngine::HandleNodeInformationalEvent
> > > > > > > > > E/PVAE    (   55): 
> > > > > > > > > PVAuthorEngine::HandleNodeInformationalEvent sends
> > > > > > > > > unknown eventType:24
> > > > > > > > > E/PVAE    (   55): 
> > > > > > > > > PVAuthorEngineNodeUtility::NodeCommandCompleted
> > > > > > > > > E/PVAE    (   55): 
> > > > > > > > > PVAuthorEngineNodeUtility::CompleteStateTransition
> > > > > > > > > E/PVAE    (   55): 
> > > > > > > > > PVAuthorEngineNodeUtility::CompleteStateTransition:
> > > > > > > > > return PVMFSuccess
> > > > > > > > > E/PVAE    (   55): 
> > > > > > > > > PVAuthorEngineNodeUtility::CompleteUtilityCmd:
> > > > > > > > > aCmd.iType=7,  aStatus=0x1
> > > > > > > > > E/PVAE    (   55): PVAuthorEngine::NodeUtilCommandCompleted
> > > > > > > > > E/PVAE    (   55): PVAuthorEngine::NodeUtilCommandCompleted 
> > > > > > > > > cmdType:14
> > > > > > > > > E/PVAE    (   55): 
> > > > > > > > > PVAuthorEngineNodeUtility::GetCommandQueueSize:
> > > > > > > > > size=0
> > > > > > > > > E/PVAE    (   55): PVAuthorEngine::SetPVAEState: aState=3
> > > > > > > > > E/PVAE    (   55): PVAuthorEngine::CompleteEngineCommand: 
> > > > > > > > > aStatus=0x1,
> > > > > > > > > aResponseData=0x0, aResponseDataSize=0
> > > > > > > > > V/AuthorDriver(   55): Command (14) completed with status(1)
> > > > > > > > > E/PVAE    (   55): PVAuthorEngine::NodeUtilCommandCompleted: 
> > > > > > > > > Exit
> > > > > > > > > E/PVAE    (   55): PVMFVideoEncPort::HandlePortActivity: 
> > > > > > > > > type=5
> > > > > > > > > E/PVAE    (   55): PVMFVideoEncPort::Run
> > > > > > > > > E/PVAE    (   55): PVMFVideoEncNode::ProcessIncomingMsg: 
> > > > > > > > > aPort=0x1acc8
> > > > > > > > > E/PVAE    (   55): PVMFVideoEncPort::HandlePortActivity: 
> > > > > > > > > type=4
> > > > > > > > > E/PVAE    (   55): PVMFVideoEncPort::Run
> > > > > > > > > E/PVAE    (   55): PVMFVideoEncPort::HandlePortActivity: 
> > > > > > > > > type=5
> > > > > > > > > E/PVAE    (   55): PVMFVideoEncPort::Run
> > > > > > > > > E/PVAE    (   55): PVMFVideoEncNode::ProcessIncomingMsg: 
> > > > > > > > > aPort=0x1acc8
> > > > > > > > > E/PVAE    (   55): PVMFVideoEncPort::HandlePortActivity: 
> > > > > > > > > type=4
> > > > > > > > > E/PVAE    (   55): PVMFVideoEncPort::Run
> > > > > > > > > E/PVAE    (   55): PVAuthorEngine::HandleNodeErrorEvent
> > > > > > > > > E/PVAE    (   55): PVAuthorEngine::SetPVAEState: aState=5
> > > > > > > > > E/AuthorDriver(   55): HandleErrorEvent(-16)
> > > > > > > > > V/MediaRecorder(  216): message received msg=1, ext1=1, 
> > > > > > > > > ext2=-16
> > > > > > > > > V/MediaRecorder(  216): callback application
> > > > > > > > > V/MediaRecorder(  216): back from callback
> > > > > > > > > ........
>
> > > > > > > > > I don't know what's the meaning of  HandleErrorEvent(-16), 
> > > > > > > > > would you
> > > > > > > > > please help me to decipher it ?
> > > > > > > > > Thank you very much!
>
> ...
>
> 阅读更多 »- 隐藏被引用文字 -
>
> - 显示引用的文字 -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to