Bug 326262

Summary: Kaffeine + libvlc hardware acceleration.
Product: [Applications] kaffeine Reporter: Andrey <andrey.a.pavlenko>
Component: generalAssignee: Mauro Carvalho Chehab <mchehab>
Status: RESOLVED INTENTIONAL    
Severity: normal    
Priority: NOR    
Version First Reported In: 1.x   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: hw_accel.patch

Description Andrey 2013-10-19 14:12:32 UTC
The above patch enables hw acceleration for video files and HTTP streams, but the acceleration for TV channels does not work and I have no idea how to fix it. Kaffeine consumes ~30% CPU even when playing SD channels.

--------------------------------------------------------- patch -----------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0f94ec2..1e4442b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -41,7 +41,7 @@ configure_file(config-kaffeine.h.cmake ${CMAKE_BINARY_DIR}/config-kaffeine.h)
 
 kde4_add_executable(kaffeine ${kaffeinedvb_SRCS} ${kaffeine_SRCS})
 target_link_libraries(kaffeine ${QT_QTSQL_LIBRARY} ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS}
-                      ${KDE4_SOLID_LIBS} ${X11_Xscreensaver_LIB} ${VLC_LIBRARY})
+                      ${KDE4_SOLID_LIBS} ${X11_Xscreensaver_LIB} ${VLC_LIBRARY} -lX11)
 install(TARGETS kaffeine ${INSTALL_TARGETS_DEFAULT_ARGS})
 install(FILES scanfile.dvb DESTINATION ${DATA_INSTALL_DIR}/kaffeine)
 install(PROGRAMS kaffeine.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
diff --git a/src/backend-vlc/vlcmediawidget.cpp b/src/backend-vlc/vlcmediawidget.cpp
index 24ba59b..9de327b 100644
--- a/src/backend-vlc/vlcmediawidget.cpp
+++ b/src/backend-vlc/vlcmediawidget.cpp
@@ -31,7 +31,7 @@ VlcMediaWidget::VlcMediaWidget(QWidget *parent) : AbstractMediaWidget(parent), v
 
 bool VlcMediaWidget::init()
 {
-	const char *arguments[] = { "--no-video-title-show" };
+	const char *arguments[] = { "--no-video-title-show", "--no-ignore-config" };
 	vlcInstance = libvlc_new(sizeof(arguments) / sizeof(arguments[0]), arguments);
 
 	if (vlcInstance == NULL) {
diff --git a/src/main.cpp b/src/main.cpp
index 4992b93..625baf5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -24,6 +24,7 @@
 #include <KUniqueApplication>
 #include "mainwindow.h"
 #include "sqlhelper.h"
+#include <X11/Xlib.h>
 
 class KaffeineApplication : public KUniqueApplication
 {
@@ -63,6 +64,7 @@ int KaffeineApplication::newInstance()
 
 int main(int argc, char *argv[])
 {
+	XInitThreads();
 	KAboutData aboutData("kaffeine", 0, ki18n("Kaffeine"), "1.3-git",
 		ki18n("A media player for KDE with digital TV support."),
 		KAboutData::License_GPL_V2, ki18n("(C) 2007-2011 The Kaffeine Authors"),
-----------------------------------------------------------------------------------------------------------------------

Reproducible: Always
Comment 1 Andrey 2013-10-19 14:14:08 UTC
Created attachment 82947 [details]
hw_accel.patch
Comment 2 Mauro Carvalho Chehab 2016-06-06 00:23:28 UTC
This bug is too old, for a version < 1.3. Closing it, as the latest version is 2.0.1, and lots of things changed since version 1.2.x, including the usage of VLC as video display backend, support for DVB-T2 and ISDB-T via libVLC, etc.

You may check on the upstream version and see if the bug was solved. The README file contains instructions about how to compile it. You can find it at our git repository: 

https://quickgit.kde.org/?p=kaffeine.git 

If you find similar issues with version 2.0.1, please re-open.