1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

miracle-wfdctl: set ximagesrc as live mode to prvent it preroll in pause

state
This commit is contained in:
Derek Dai 2017-03-16 16:28:15 +08:00
parent d8cd118119
commit 1156c08c3f
No known key found for this signature in database
GPG key ID: E109CC97553EF009
3 changed files with 11 additions and 1 deletions

View file

@ -22,6 +22,7 @@ pkg_check_modules (GLIB2 REQUIRED glib-2.0)
pkg_check_modules (UDEV REQUIRED libudev) pkg_check_modules (UDEV REQUIRED libudev)
pkg_check_modules (SYSTEMD REQUIRED libsystemd) pkg_check_modules (SYSTEMD REQUIRED libsystemd)
pkg_check_modules (GSTREAMER REQUIRED gstreamer-1.0) pkg_check_modules (GSTREAMER REQUIRED gstreamer-1.0)
pkg_check_modules (GSTREAMER_BASE REQUIRED gstreamer-base-1.0)
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
check_c_compiler_flag(-fstack-protector-strong HAS_STACK_PROTCTOR_STRONG) check_c_compiler_flag(-fstack-protector-strong HAS_STACK_PROTCTOR_STRONG)

View file

@ -58,6 +58,7 @@ set(miracle-wfdctl_SRCS ctl-cli.c
include_directories(${CMAKE_BINARY_DIR} include_directories(${CMAKE_BINARY_DIR}
${GSTREAMER_INCLUDE_DIRS} ${GSTREAMER_INCLUDE_DIRS}
${GSTREAMER_BASE_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/shared) ${CMAKE_SOURCE_DIR}/src/shared)
@ -75,7 +76,8 @@ endif(READLINE_FOUND)
target_link_libraries(miracle-wfdctl target_link_libraries(miracle-wfdctl
miracle-shared miracle-shared
${GSTREAMER_LIBRARIES}) ${GSTREAMER_LIBRARIES}
${GSTREAMER_BASE_LIBRARIES})
########### install files ############### ########### install files ###############

View file

@ -24,6 +24,7 @@
#include <unistd.h> #include <unistd.h>
#include <time.h> #include <time.h>
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/base/base.h>
#include "wfd-session.h" #include "wfd-session.h"
#include "shl_log.h" #include "shl_log.h"
#include "rtsp.h" #include "rtsp.h"
@ -566,6 +567,7 @@ static int wfd_out_session_create_pipeline(struct wfd_session *s)
char vsrc_param3[16] = "", vsrc_param4[16] = ""; char vsrc_param3[16] = "", vsrc_param4[16] = "";
struct wfd_out_session *os = wfd_out_session(s); struct wfd_out_session *os = wfd_out_session(s);
GstElement *pipeline; GstElement *pipeline;
GstElement *vsrc;
GstBus *bus; GstBus *bus;
GError *error = NULL; GError *error = NULL;
const char **tmp; const char **tmp;
@ -694,6 +696,11 @@ static int wfd_out_session_create_pipeline(struct wfd_session *s)
return -1; return -1;
} }
vsrc = gst_bin_get_by_name(GST_BIN(pipeline), "vsrc");
gst_base_src_set_live(GST_BASE_SRC(vsrc), true);
g_object_unref(vsrc);
vsrc = NULL;
r = gst_element_set_state(pipeline, GST_STATE_READY); r = gst_element_set_state(pipeline, GST_STATE_READY);
if(GST_STATE_CHANGE_FAILURE == r) { if(GST_STATE_CHANGE_FAILURE == r) {
g_object_unref(pipeline); g_object_unref(pipeline);