libvideorender: CF2 signal first pts for weston [1/1]
PD#TV-118599
Problem:
don't signal first frame pts on weston
Solution:
signal first frame pts on weston
Verify:
ap222
Change-Id: I4ab0a0daf0884dbc68872fbfcee08dea92f6ea35
Signed-off-by: fei.deng <fei.deng@amlogic.com>
diff --git a/weston/wayland_display.cpp b/weston/wayland_display.cpp
index 90a1608..8e0afd0 100644
--- a/weston/wayland_display.cpp
+++ b/weston/wayland_display.cpp
@@ -648,6 +648,7 @@
mFullScreen = true; //default is full screen
mAmlConfig = NULL;
mKeepLastFrame = 0; //default is off keep last frame
+ mSignalFirstFramePts = false;
//weston config private api
mAmlConfigAPIList.enableDropFrame = false;
mAmlConfigAPIList.enableKeepLastFrame = false;
@@ -1369,6 +1370,10 @@
{
RenderBuffer *renderBuffer = buf->getRenderBuffer();
TRACE(mLogCategory,"handle displayed renderBuffer :%p,PTS:%lld us,realtime:%lld us",renderBuffer,renderBuffer->pts/1000,buf->getRenderRealTime());
+ if (!mSignalFirstFramePts) {
+ mSignalFirstFramePts = true;
+ mWaylandPlugin->handleMsgNotify(MSG_FIRST_FRAME, (void*)&renderBuffer->pts);
+ }
mWaylandPlugin->handleFrameDisplayed(renderBuffer);
}
diff --git a/weston/wayland_display.h b/weston/wayland_display.h
index de07fcd..e3e8f55 100644
--- a/weston/wayland_display.h
+++ b/weston/wayland_display.h
@@ -357,6 +357,7 @@
bool mRedrawingPending;//it will be true when weston obtains a buffer rendering,otherwise false when rendered
AmlConfigAPIList mAmlConfigAPIList;
int mKeepLastFrame; //keep last frame when playback end
+ bool mSignalFirstFramePts; //signal the first displayed frame pts
};
#endif /*__WAYLAND_DISPLAY_H__*/
\ No newline at end of file
diff --git a/weston/wayland_plugin.cpp b/weston/wayland_plugin.cpp
index 015b07a..d47123c 100644
--- a/weston/wayland_plugin.cpp
+++ b/weston/wayland_plugin.cpp
@@ -265,6 +265,13 @@
}
}
+void WaylandPlugin::handleMsgNotify(int type, void *detail)
+{
+ if (mCallback) {
+ mCallback->doMsgCallback(mUserData, type, detail);
+ }
+}
+
void WaylandPlugin::readyToRun()
{
}
diff --git a/weston/wayland_plugin.h b/weston/wayland_plugin.h
index 2371145..30bec81 100644
--- a/weston/wayland_plugin.h
+++ b/weston/wayland_plugin.h
@@ -51,6 +51,7 @@
virtual void handleFrameDisplayed(RenderBuffer *buffer);
//buffer droped callback
virtual void handleFrameDropped(RenderBuffer *buffer);
+ void handleMsgNotify(int type, void *detail);
static void queueFlushCallback(void *userdata,void *data);
private:
PluginCallback *mCallback;