diff options
author | phintuka <phintuka> | 2006-06-03 09:44:41 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2006-06-03 09:44:41 +0000 |
commit | a984ea3661e35144f00c34895e67f87e3ed64894 (patch) | |
tree | 9e1b0ee0d49c7cb731bfd646532baa5c19e436b0 | |
parent | a4c9d958044ec4b2a8d6b963f5e91e957eac1697 (diff) | |
download | xineliboutput-a984ea3661e35144f00c34895e67f87e3ed64894.tar.gz xineliboutput-a984ea3661e35144f00c34895e67f87e3ed64894.tar.bz2 |
Initial import
-rw-r--r-- | COPYING | 340 | ||||
-rw-r--r-- | Makefile | 398 | ||||
-rw-r--r-- | README | 233 | ||||
-rw-r--r-- | black_720x576.mpg | bin | 0 -> 8815 bytes | |||
-rw-r--r-- | nosignal_720x576.mpg | bin | 0 -> 13195 bytes | |||
-rw-r--r-- | vdrlogo_720x576.mpg | bin | 0 -> 22739 bytes | |||
-rw-r--r-- | xineliboutput.c | 204 |
7 files changed, 1175 insertions, 0 deletions
diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..f90922ee --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..f2f6cd5f --- /dev/null +++ b/Makefile @@ -0,0 +1,398 @@ +# +# Makefile for a Video Disk Recorder plugin +# +# $Id: Makefile,v 1.1 2006-06-03 09:44:41 phintuka Exp $ + +# The official name of this plugin. +# This name will be used in the '-P...' option of VDR to load the plugin. +# By default the main source file also carries this name. +# + +PLUGIN = xineliboutput + +### +### check for xine-lib and X11 +### + +XINELIBOUTPUT_FB = 0 +XINELIBOUTPUT_X11 = 0 +XINELIBOUTPUT_XINEPLUGIN = $(shell (xine-config --cflags >& /dev/null && echo "1") || echo "0") +ifeq ($(XINELIBOUTPUT_XINEPLUGIN), 1) + XINELIBOUTPUT_FB = $(XINELIBOUTPUT_XINEPLUGIN) + XINELIBOUTPUT_X11 = $(shell (((echo "\#include <X11/Xlib.h>";echo "int main(int c,char* v[]) {return 0;}") > testx.c && gcc -c testx.c -o testx.o >&/dev/null) && echo "1") || echo "0" ; rm -f testx.* >/dev/null) + + ifeq ($(XINELIBOUTPUT_X11), 1) + #$(warning Detected X11) + else + $(warning ********************************************************) + $(warning X11 not detected ! X11 frontends will not be compiled.) + $(warning ********************************************************) + endif +else + $(warning ********************************************************) + $(warning xine-lib not detected ! frontends will not be compiled.) + $(warning ********************************************************) +endif + +# +# Override configuration here or in ../../../Make.config +# + +#XINELIBOUTPUT_X11 = 1 +#XINELIBOUTPUT_FB = 1 +#XINELIBOUTPUT_XINEPLUGIN = 1 +#XINELIBOUTPUT_VDRPLUGIN = 1 +#ENABLE_TEST_POSTPLUGINS = 1 +#$(warning ********************************************************) +#$(warning TEST PLUGINS ENABLED) +#$(warning ********************************************************) + +### +### The version number of this plugin (taken from the main source file): +### + +VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') + +### +### The C++ compiler and options: +### + +CXX ?= g++ +OPTFLAGS ?= +CXXFLAGS ?= -O3 -pipe -Wall -Woverloaded-virtual -fPIC -g + +CC ?= gcc +CFLAGS ?= -O3 -pipe -Wall -fPIC -g + +### +### The directory environment: +### + +VDRDIR = ../../.. +LIBDIR = ../../lib +TMPDIR = /tmp + +### +### Allow user defined options to overwrite defaults: +### + +-include $(VDRDIR)/Make.config + +### +### check for VDR +### + +# XINELIBOUTPUT_VDRPLUGIN ?= $(shell (grep 'define VDRVERSION ' $(VDRDIR)/config.h > /dev/null && echo "1") || echo "0") +# ifeq ($(XINELIBOUTPUT_VDRPLUGIN), 0) + +### The version number of VDR (taken from VDR's "config.h"): +#VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') +VDRVERSION = $(shell sed -ne '/define VDRVERSION/ { s/^.*"\(.*\)".*$$/\1/; p }' $(VDRDIR)/config.h) +ifeq ($(strip $(VDRVERSION)),) + $(warning ********************************************************) + $(warning VDR not detected ! VDR plugin will not be compiled.) + $(warning ********************************************************) + XINELIBOUTPUT_VDRPLUGIN = 0 +else + ### The version number of VDR's plugin API (taken from VDR's "config.h"): + #APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') + APIVERSION = $(shell sed -ne '/define APIVERSION/ { s/^.*"\(.*\)".*$$/\1/; p }' $(VDRDIR)/config.h) + ifeq ($(strip $(APIVERSION)),) + $(warning VDR APIVERSION missing, using VDRVERSION $(VDRVERSION) ) + APIVERSION = $(VDRVERSION) + endif + XINELIBOUTPUT_VDRPLUGIN = 1 +endif + +### +### The name of the distribution archive: +### + +ARCHIVE = $(PLUGIN)-$(VERSION) +PACKAGE = vdr-$(ARCHIVE) + +### +### The name of executable and libraries +### + +VDRSXFE = vdr-sxfe +VDRFBFE = vdr-fbfe +XINEINPUTVDR = xineplug_inp_xvdr.so +XINEPOSTAUTOSCALE = xineplug_post_autoscale.so +XINEPOSTHEADPHONE = xineplug_post_headphone.so + +### +### which programs and libs to build +### + +ifeq ($(XINELIBOUTPUT_X11), 1) + VDRSXFE_EXEC = $(VDRSXFE) + ifeq ($(XINELIBOUTPUT_VDRPLUGIN), 1) + VDRPLUGIN_SXFE_SO = lib$(PLUGIN)-sxfe.so + else + VDRPLUGIN_SXFE_SO = + endif +else + VDRSXFE_EXEC = + VDRPLUGIN_SXFE_SO = +endif +ifeq ($(XINELIBOUTPUT_FB), 1) + VDRFBFE_EXEC = $(VDRFBFE) + ifeq ($(XINELIBOUTPUT_VDRPLUGIN), 1) + VDRPLUGIN_FBFE_SO = lib$(PLUGIN)-fbfe.so + else + VDRPLUGIN_FBFE_SO = + endif +else + VDRFBFE_EXEC = + VDRPLUGIN_FBFE_SO = +endif +ifeq ($(XINELIBOUTPUT_XINEPLUGIN), 1) + XINEINPUTVDR_SO = $(XINEINPUTVDR) + XINEPLUGINDIR = $(shell xine-config --plugindir) + ifeq ($(ENABLE_TEST_POSTPLUGINS), 1) + XINEPOSTAUTOSCALE_SO = $(XINEPOSTAUTOSCALE) + XINEPOSTHEADPHONE_SO = $(XINEPOSTHEADPHONE) + else + XINEPOSTAUTOSCALE_SO = + XINEPOSTHEADPHONE_SO = + endif +else + XINEINPUTVDR_SO = + XINEPLUGINDIR = ./ + XINEPOSTAUTOSCALE_SO = + XINEPOSTHEADPHONE_SO = +endif +ifeq ($(XINELIBOUTPUT_VDRPLUGIN), 1) + VDRPLUGIN_SO = libvdr-$(PLUGIN).so +else + VDRPLUGIN_SO = +endif + +### +### Includes and Defines (add further entries here): +### + +INCLUDES += -I$(VDRDIR)/include +LIBS_XINE += $(shell xine-config --libs) +LIBS_X11 += -L/usr/X11R6/lib -lX11 -lXv -lXext + +DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' \ + -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ + -DPLUGINLIBDIR='"$(PLUGINLIBDIR)"' \ + -DXINELIBOUTPUT_VERSION='"$(VERSION)"' + +# check for yaegp patch +DEFINES += $(shell grep 'vidWin' \$(VDRDIR)/osd.h > /dev/null && echo "-DYAEGP_PATCH") + +ifeq ($(XINELIBOUTPUT_XINEPLUGIN), 1) + CFLAGS += $(shell xine-config --cflags) +endif + +ifeq ($(ENABLE_TEST_POSTPLUGINS), 1) + DEFINES += -DENABLE_TEST_POSTPLUGINS +endif + +#CFLAGS += -Wall -pedantic -ansi +#CXXFLAGS += -Wall -ansi -pedantic + +### +### configuration +### + +#DEFINES += -DENABLE_SUSPEND +#DEFINES += -DHAVE_XV_FIELD_ORDER +#DEFINES += -DSUSPEND_BY_PLAYER + +### +### The object files (add further files here): +### +ifeq ($(XINELIBOUTPUT_VDRPLUGIN), 1) + OBJS = $(PLUGIN).o device.o frontend.o osd.o config.o menu.o setup_menu.o \ + i18n.o menuitems.o media_player.o equalizer.o \ + frontend_local.o frontend_svr.o \ + tools/cxsocket.o tools/udp_pes_scheduler.o \ + tools/backgroundwriter.o + OBJS_MPG = black_720x576.o nosignal_720x576.o vdrlogo_720x576.o +else + OBJS = + OBJS_MPG = +endif +ifeq ($(XINELIBOUTPUT_XINEPLUGIN), 1) +else +endif +ifeq ($(XINELIBOUTPUT_X11), 1) + OBJS_SXFE_SO = xine_sxfe_frontend.o xine/post.o + OBJS_SXFE = xine_sxfe_frontend_standalone.o xine/post.o +else + OBJS_SXFE_SO = + OBJS_SXFE = +endif +ifeq ($(XINELIBOUTPUT_FB), 1) + OBJS_FBFE_SO = xine_fbfe_frontend.o xine/post.o + OBJS_FBFE = xine_fbfe_frontend_standalone.o xine/post.o +else + OBJS_FBFE_SO = + OBJS_FBFE = +endif + +### +### Implicit rules: +### + +%.o: %.c + $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< + +### +### Dependencies: +### + +MAKEDEP = g++ -MM -MG +DEPFILE = .dependencies +$(DEPFILE): Makefile + @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) $(OBJS_SXFE_SO:%.o=%.c) $(OBJS_FBFE_SO:%.o=%.c) > $@ + +-include $(DEPFILE) + +DEFINES += -Wall + +### +### Rules: +### + +mpg2c: mpg2c.c + $(CC) mpg2c.c -o $@ + +black_720x576.c: mpg2c black_720x576.mpg + @./mpg2c black black_720x576.mpg black_720x576.c +nosignal_720x576.c: mpg2c nosignal_720x576.mpg + @./mpg2c nosignal nosignal_720x576.mpg nosignal_720x576.c +vdrlogo_720x576.c: mpg2c vdrlogo_720x576.mpg + @./mpg2c vdrlogo vdrlogo_720x576.mpg vdrlogo_720x576.c + +xine_input_vdr.o: xine_input_vdr.c xine_input_vdr.h xine_osd_command.h + $(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $(OPTFLAGS) xine_input_vdr.c +xine/post.o: xine/post.c xine/post.h + $(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $(OPTFLAGS) xine/post.c -o $@ +xine_post_autoscale.o: xine_post_autoscale.c + $(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $(OPTFLAGS) xine_post_autoscale.c +xine_post_headphone.o: xine_post_headphone.c + $(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $(OPTFLAGS) xine_post_headphone.c + +xine_sxfe_frontend.o: xine_sxfe_frontend.c xine_frontend.c xine_frontend.h \ + xine_input_vdr.h xine_osd_command.h xine/post.h logdefs.h \ + xineliboutput.c + $(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $(OPTFLAGS) xine_sxfe_frontend.c +xine_fbfe_frontend.o: xine_fbfe_frontend.c xine_frontend.c xine_frontend.h \ + xine_input_vdr.h xine_osd_command.h xine/post.h logdefs.h \ + xineliboutput.c + $(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $(OPTFLAGS) xine_fbfe_frontend.c +xine_sxfe_frontend_standalone.o: xine_sxfe_frontend.c xine_frontend.c \ + xine_frontend.h xine_input_vdr.h xine_osd_command.h \ + xine/post.h logdefs.h xine_frontend_main.c xine_frontend_lirc.c \ + xine_frontend_lirc.c xineliboutput.c + $(CC) $(CFLAGS) -c $(DEFINES) -DFE_STANDALONE $(INCLUDES) $(OPTFLAGS) \ + xine_sxfe_frontend.c -o $@ +xine_fbfe_frontend_standalone.o: xine_fbfe_frontend.c xine_frontend.c \ + xine_frontend.h xine_input_vdr.h xine_osd_command.h \ + xine/post.h logdefs.h xine_frontend_main.c xine_frontend_lirc.c \ + xine_frontend_lirc.c xineliboutput.c + $(CC) $(CFLAGS) -c $(DEFINES) -DFE_STANDALONE $(INCLUDES) $(OPTFLAGS) \ + xine_fbfe_frontend.c -o $@ + +# +# targets +# + +all: $(VDRPLUGIN_SO) $(VDRPLUGIN_SXFE_SO) $(VDRPLUGIN_FBFE_SO) \ + $(VDRSXFE_EXEC) $(VDRFBFE_EXEC) $(XINEINPUTVDR_SO) \ + $(XINEPOSTAUTOSCALE_SO) $(XINEPOSTHEADPHONE_SO) + + +frontends: $(VDRSXFE_EXEC) $(VDRFBFE_EXEC) $(XINEINPUTVDR_SO) \ + $(XINEPOSTAUTOSCALE_SO) $(XINEPOSTHEADPHONE_SO) + + +.PHONY: all + + +ifeq ($(XINELIBOUTPUT_VDRPLUGIN), 1) +$(VDRPLUGIN_SO): $(OBJS) $(OBJS_MPG) + $(CXX) $(CXXFLAGS) -shared -fvisibility=hidden $(OBJS) $(OBJS_MPG) $(LIBS) -o $@ + @-rm -rf $(LIBDIR)/$@.$(APIVERSION) + @cp $@ $(LIBDIR)/$@.$(APIVERSION) +endif + +ifeq ($(XINELIBOUTPUT_X11), 1) +$(VDRPLUGIN_SXFE_SO): $(OBJS_SXFE_SO) + $(CC) $(CFLAGS) -shared -fvisibility=hidden $(OBJS_SXFE_SO) $(LIBS_X11) $(LIBS_XINE) -o $@ + @-rm -rf $(LIBDIR)/$(VDRPLUGIN_SXFE_SO).$(VERSION) + @cp $@ $(LIBDIR)/$(VDRPLUGIN_SXFE_SO).$(VERSION) +$(VDRSXFE): $(OBJS_SXFE) + $(CC) -g $(OBJS_SXFE) $(LIBS_X11) $(LIBS_XINE) -o $@ +endif + +ifeq ($(XINELIBOUTPUT_FB), 1) +$(VDRPLUGIN_FBFE_SO): $(OBJS_FBFE_SO) + $(CC) $(CFLAGS) -shared -fvisibility=hidden $(OBJS_FBFE_SO) $(LIBS_XINE) -o $@ + @-rm -rf $(LIBDIR)/$(VDRPLUGIN_FBFE_SO).$(VERSION) + @cp $@ $(LIBDIR)/$(VDRPLUGIN_FBFE_SO).$(VERSION) +$(VDRFBFE): $(OBJS_FBFE) + $(CC) -g $(OBJS_FBFE) $(LIBS_XINE) -o $@ +endif + +ifeq ($(XINELIBOUTPUT_XINEPLUGIN), 1) +$(XINEINPUTVDR_SO): xine_input_vdr.o + $(CC) -g -shared -fvisibility=hidden xine_input_vdr.o $(LIBS_XINE) -o $@ + @-rm -rf $(XINEPLUGINDIR)/$@ + @cp $@ $(XINEPLUGINDIR)/ +endif + +ifeq ($(ENABLE_TEST_POSTPLUGINS), 1) +$(XINEPOSTAUTOSCALE_SO): xine_post_autoscale.o + $(CC) -g -shared -fvisibility=hidden xine_post_autoscale.o $(LIBS_XINE) -o $@ + @-rm -rf $(XINEPLUGINDIR)/$@ + @cp $@ $(XINEPLUGINDIR)/ +$(XINEPOSTHEADPHONE_SO): xine_post_headphone.o + $(CC) -g -shared -fvisibility=hidden xine_post_headphone.o $(LIBS_XINE) -o $@ + @-rm -rf $(XINEPLUGINDIR)/$@ + @cp $@ $(XINEPLUGINDIR)/ +endif + + +install: all +ifeq ($(XINELIBOUTPUT_XINEPLUGIN), 1) + @-rm -rf $(XINEPLUGINDIR)/$(XINEINPUTVDR) + @-cp $(XINEINPUTVDR) $(XINEPLUGINDIR)/ +endif +ifeq ($(ENABLE_TEST_POSTPLUGINS), 1) + @-rm -rf $(XINEPLUGINDIR)/$(XINEPOSTHEADPHONE) + @-rm -rf $(XINEPLUGINDIR)/$(XINEPOSTAUTOSCALE) + @-cp $(XINEPOSTHEADPHONE) $(XINEPLUGINDIR)/ + @-cp $(XINEPOSTAUTOSCALE) $(XINEPLUGINDIR)/ +endif +ifeq ($(XINELIBOUTPUT_FB), 1) + @-rm -rf /usr/bin/vdr-fbfe + @-cp vdr-fbfe /usr/bin/ +endif +ifeq ($(XINELIBOUTPUT_X11), 1) + @-rm -rf /usr/bin/vdr-sxfe + @-cp vdr-sxfe /usr/bin/ +endif + + +dist: clean + @-rm -rf $(TMPDIR)/$(ARCHIVE) + @mkdir $(TMPDIR)/$(ARCHIVE) + @cp -a * $(TMPDIR)/$(ARCHIVE) + @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) + @-rm -rf $(TMPDIR)/$(ARCHIVE) + @echo Distribution package created as $(PACKAGE).tgz + + +clean: + @-rm -f $(DEPFILE) *.so *.o *.tgz core* *~ *.flc *.bak \ + tools/*.o tools/*~ tools/*.flc xine/*.o xine/*~ \ + xine/*.flc $(VDR_FBFE) $(VDR_SXFE) mpg2c black_720x576.c \ + nosignal_720x576.c vdrlogo_720x576.c vdr-sxfe vdr-fbfe + @@ -0,0 +1,233 @@ +This is a "plugin" for the Video Disk Recorder (VDR). + +Written by: Petri Hintukainen <Petri.Hintukainen@hut.fi> + +Project's homepage: http://www.hut.fi/u/phintuka/vdr/ + +Latest version available at: http://www.hut.fi/u/phintuka/vdr/ + +See the file COPYING for license information. + + +Description + + Simple framebuffer and/or X11 front-end for VDR. + (displays OSD and video in raw X/Xv/XvMC window or + Linux framebuffer/DirectFB). + + Support for local and remote frontends. + + Built-in image and media player supports playback of most known media + files (avi/mp3/divx/jpeg/...) and network radio/video streams + (http, rtsp, ...) directly from VDR. + + +Requirements + + - vdr-1.3.42 or later + - xine-lib 1.1.1 or later + (not required for server in network-only usage) + - Enough CPU power and memory to decode streams + (PII 400Mhz + 64M should be enough with Xv or DirectFB) + +WARNING + + Remote (network) mode should be used only in firewalled + environment; it gives anyone full control to VDR ! + Full access is allowed to all hosts listed in svdrphosts.conf. + + Multicast streaming can flood your internet connection and/or + wireless LAN. If there is no router (or intelligent switch ?) + all multicast packets will be broadcasted to all network links. + This will flood slow network links: + - Internet connection if outgoing bandwith is < 10 Mbit/s + - Wireless LAN (11 or 54 Mbit/s). + By default multicast TTL is set to 1 so multicast packets should + be stopped to first router regardless of network configuration. + + +Buildtime options + + X11 and xine-lib are detected by Makefile. + It is possible to override auto-detection by adding + following definitions to VDR's Make.config: + + enable/disable building of X11 frontends: + XINELIBOUTPUT_X11 = 1 + XINELIBOUTPUT_X11 = 0 + + enable/disable framebuffer frontends: + XINELIBOUTPUT_FB = 1 + XINELIBOUTPUT_FB = 0 + + enable/disable xine (input)plugin: + XINELIBOUTPUT_XINEPLUGIN = 1 + XINELIBOUTPUT_XINEPLUGIN = 0 + + or changing corresponding lines in plugin's Makefile. + + xineplug_inp_vdr.so is automatically copied to xine's plugin directory. + Writing to xine's plugin directory usually requires root permissions. + + It is possible to compile only remote frontends with command + "make frontends". + + +Usage examples (VDR plugin) + + If no arguments are given, both X11 and framebuffer frontends are tried. + First working frontend is used with best available video driver. + Complete list of available command-line arguments can be obtained + with "vdr --help". + + Only local frontend, X11/Xv video, alsa audio: + vdr -P"xineliboutput --local=sxfe --video=xv --audio=alsa --noremote" + + Only local frontend, (slow) X11 video, oss audio: + vdr -P"xineliboutput --local=sxfe --video=x11 --audio=oss --noremote" + + Only local frontend, DirectFB: + vdr -P"xineliboutput --local=fbfe --video=DirectFB --noremote" + + Only remote frontend(s): + vdr -P"xineliboutput --local=none --remote=37890" + + Local and remote frontends: + vdr -P"xineliboutput --local=sxfe --remote=37890" + or + vdr -P"xineliboutput --local=fbfe --remote=37890" + + +Using remote frontends + + Two remote frontends are included, vdr-fbfe for framebuffer and + vdr-sxfe for X11. + Complete list of available command-line arguments can be obtained + with "vdr-??fe --help". + + Frontend should find server automatically (from local subnet) + and negoate best available transport. If frontend does not + find server (or specific transport should be used), mrl must + be given on command line. + + Examples: + + Search for VDR (xineliboutput) server, connect to it and + negoatite best available transport. Use best available audio + and video driver. + vdr-fbfe + or + vdr-sxfe + + Connect to 192.168.1.3 default port and negoate best available transport + vdr-fbfe xvdr://192.168.1.3 + + Connect to 192.168.2.100, port 12550 and use TCP transport + vdr-fbfe xvdr:tcp://192.168.2.100:12550 + + Automatically search for VDR server and use UDP transport + vdr-fbfe xvdr:udp: + + Available transports for video/audio + pipe Use local pipe; server and front-end must be running in + same machine + rtp Use RTP/UDP multicast for data and TCP for control. + Multiple frontends can receive same stream. + udp Use UDP unicast for data and TCP for control. + tcp Use TCP protocol for control and data. Both channels + use same server port and are opened by client. + + Forwarding lirc keys to server + Use option --lirc with optional lircd socket name to + forward LIRC commands from client to server. + + Audio driver + Use alsa: + vdr-fbfe --audio alsa + Use alsa (and specific card/sub-device): + vdr-fbfe --audio alsa:plughw:1,1 + + Video driver (and display / device): + With X11 frontend (vdr-sxfe): + vdr-sxfe --video x11 | xshm | xv | xvmc | xxmc [:display] + Examples: + --video xv + --video xvmc:127.0.0.1:1.0 + + With framebuffer frontend (vdr-fbfe): + --video [fb | DirectFB] [:fb_device] + examples: + --video DirectFB + --video fb:/dev/fb/1 + + De-interlacing + De-interlacing can be switched on with command-line option + --post tvtime + Examples: + vdr-sxfe --post tvtime:method=Linear,cheap_mode=1,pulldown=0,use_progressive_frame_flag=1 + vdr -P"xineliboutput --post=tvtime:method=Linear,cheap_mode=1,pulldown=0,use_progressive_frame_flag=1" + + +Using with xine-ui (xine, fbxine, gxine, ...) + + Examples: + xine "xvdr://127.0.0.1#nocache;demux:mpeg_block" + xine "xvdr:tcp://127.0.0.1:37890#nocache;demux:mpeg_block" + xine "xvdr:udp://127.0.0.1:37890#nocache;demux:mpeg_block" + + "#nocache;demux:mpeg_block" should always be appended to end of mrl. + + Remote mode must be enabled in VDR plugin. + + +Image viewer key bindings + + Up/Down Next/previous image + Left/Right Jump 5 images forward/backward + Yellow Delete current image + Back Return to image list + Stop/Blue Exit image viewer + Play Start slide show + Pause Stop slide show + FastFF/FastRew Start slide show; Increase/decrease slide show speed; + Change slideshow direction + Ok Toggle replay display mode + + +Media player key bindings + + Back Return to file list + Red Jump to beginning of file + Green Jump 1 min back + Yellow Jump 1 min forward + Stop/Blue Stop replay + 1, User8 Jump 20 s back + 3, User9 Jump 20 s forward + 2 Move subtitles up + 5 Move subtitles down + Pause Pause replay + Play Play + Ok Toggle replay display mode + + +Aspect ratio setting + + There are 4 possible aspect ratio settings for display: + + default Aspect ratio is calculated from display resolution. + + 4:3 4:3 video is scaled to fill whole window; + 16:9 video has black bars at top and bottom + + 16:9 16:9 video is scaled to fill whole window; + 4:3 video has black bars at left and right. + + auto 4:3 and 16:9 are displayed as is; + wider than 16:9 is displayed as 16:9. + (useful with 16:9 TV if TV can switch between + 16:9 and 4:3 -> 16:9 smart scaling) + + +Notes + + Current xine-lib does not support unscaled overlays with DirectFB. diff --git a/black_720x576.mpg b/black_720x576.mpg Binary files differnew file mode 100644 index 00000000..1d466be0 --- /dev/null +++ b/black_720x576.mpg diff --git a/nosignal_720x576.mpg b/nosignal_720x576.mpg Binary files differnew file mode 100644 index 00000000..cff01b4c --- /dev/null +++ b/nosignal_720x576.mpg diff --git a/vdrlogo_720x576.mpg b/vdrlogo_720x576.mpg Binary files differnew file mode 100644 index 00000000..2ef0f3f4 --- /dev/null +++ b/vdrlogo_720x576.mpg diff --git a/xineliboutput.c b/xineliboutput.c new file mode 100644 index 00000000..fd4bb9dc --- /dev/null +++ b/xineliboutput.c @@ -0,0 +1,204 @@ +/* + * vdr-xineliboutput: xine-lib based output device plugin for VDR + * + * Copyright (C) 2003-2006 Petri Hintukainen <phintuka@cc.hut.fi> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Or, point your browser to http://www.gnu.org/copyleft/gpl.html + * + * + * xineliboutput.c: VDR Plugin interface + * + * $Id: xineliboutput.c,v 1.1 2006-06-03 09:44:41 phintuka Exp $ + * + */ + +#include <vdr/plugin.h> + +#include "logdefs.h" +#include "i18n.h" +#include "config.h" +#include "device.h" +#include "setup_menu.h" +#include "menu.h" + +#if VDRVERSNUM < 10342 +# if VDRVERSNUM < 10331 +# error VDR versions < 1.3.31 are not supported ! +# endif +# warning This plugin is not tested with VDR versions < 1.3.42 ! +#endif + +//---------------------------------plugin------------------------------------- + +static const char *VERSION = "0.99rc4"; +static const char *DESCRIPTION = "X11/xine-lib output plugin"; +static const char *MAINMENUENTRY = "Xine-lib"; + +cOsdObject *g_PendingMenuAction = NULL; + +class cPluginXinelibOutput : public cPlugin +{ + private: + // Add any member variables or functions you may need here. + + public: + cPluginXinelibOutput(void); + virtual ~cPluginXinelibOutput(); + virtual const char *Version(void) { return VERSION; } + virtual const char *Description(void) { return tr(DESCRIPTION); } + virtual const char *CommandLineHelp(void); + virtual bool ProcessArgs(int argc, char *argv[]); + virtual bool Initialize(void); + virtual bool Start(void); + virtual void Stop(void); + //virtual void Housekeeping(void); + virtual const char *MainMenuEntry(void) { return xc.hide_main_menu ? NULL : tr(MAINMENUENTRY); } + virtual cOsdObject *MainMenuAction(void); + virtual cMenuSetupPage *SetupMenu(void); + virtual bool SetupParse(const char *Name, const char *Value); +}; + +cPluginXinelibOutput::cPluginXinelibOutput(void) +{ + // Initialize any member variables here. + // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL + // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! +} + +cPluginXinelibOutput::~cPluginXinelibOutput() +{ + // Clean up after yourself! + cXinelibDevice::Dispose(); +} + + +const char cmdLineHelp[] = +" -l NAME --local=NAME Use local frontend NAME\n" +" Supported frontends:\n" +" sxfe (X11)\n" +" fbfe (framebuffer)\n" +" none (only remote frontends)\n" +" -V NAME --video=NAME Use video driver NAME\n" +" Supported values:\n" +" for sxfe: auto, x11, xshm, xv, xvmc, xxmc, none\n" +" for fbfe: auto, fb, DirectFB, none\n" +" -A NAME --audio=NAME Use audio driver NAME\n" +" Supported values:\n" +" auto, alsa, oss, arts, esound, none\n" +" -L --nolocal No local frontend, only remote frontends\n" +#if 0 +" -m M --modeline=M Use modeline M for local frontend\n" +" (example: )\n" +#endif +" -k --xkeyboard X11 keyboard in use\n" +" -r PORT --remote=PORT Listen PORT for remote clients\n" +" (default "LISTEN_PORT_S")\n" +" -R --noremote No remote clients\n" +" -f --fullscreen Fullscreen mode (X11)\n" +" -w --window Window mode (X11)\n" +" -d DISP --display=DISP Use X11 display DISP\n" +" (or framebuffer device name)" +" -P POST --post=POST Use xine post plugin POST\n" +" format: pluginname[:arg=val[,arg=val]][,...]\n" +" example: \n" +" --post=upmix;tvtime:enabled=1,cheap_mode=1\n" +//" If multiple post plugins are given, all\n" +//" will be initialized." +" -p --primary Force xineliboutput to be primary device when\n" +" there are active frontend(s)\n" +; + +const char *cPluginXinelibOutput::CommandLineHelp(void) +{ + // Return a string that describes all known command line options. + return cmdLineHelp; +} + +bool cPluginXinelibOutput::ProcessArgs(int argc, char *argv[]) +{ + // Implement command line argument processing here if applicable. + return xc.ProcessArgs(argc, argv); +} + +bool cPluginXinelibOutput::Initialize(void) +{ + // Initialize any background activities the plugin shall perform. + TRACEF("cPluginXinelibOutput::Initialize"); + + RegisterI18n(Phrases); + cXinelibDevice::Instance(); + return true; +} + +bool cPluginXinelibOutput::Start(void) +{ + // Start any background activities the plugin shall perform. + TRACEF("cPluginXinelibOutput::Start"); + return cXinelibDevice::Instance().StartDevice(); +} + +void cPluginXinelibOutput::Stop(void) +{ + // Start any background activities the plugin shall perform. + TRACEF("cPluginXinelibOutput::Stop"); + return cXinelibDevice::Instance().StopDevice(); +} + +cOsdObject *cPluginXinelibOutput::MainMenuAction(void) +{ + // Perform the action when selected from the main VDR menu. + TRACEF("cPluginXinelibOutput::MainMenuAction"); + + if(xc.main_menu_mode == CloseOsd) { + xc.main_menu_mode = ShowMenu; + return NULL; + } + + if(g_PendingMenuAction) { + cOsdObject *tmp = g_PendingMenuAction; + g_PendingMenuAction = NULL; + return tmp; + } + + if(xc.hide_main_menu) + return NULL; + +#ifdef HAVE_XV_FIELD_ORDER + xc.field_order = xc.field_order ? 0 : 1; + cXinelibDevice::Instance().ConfigureWindow(xc.fullscreen, xc.width, xc.height, + xc.modeswitch, xc.modeline, xc.display_aspect, + xc.scale_video, xc.field_order); +#endif + return new cMenuXinelib(); +} + +cMenuSetupPage *cPluginXinelibOutput::SetupMenu(void) +{ + // Return a setup menu in case the plugin supports one. + TRACEF("cPluginXinelibOutput::SetupMenu"); + return new cMenuSetupXinelib(); +} + +bool cPluginXinelibOutput::SetupParse(const char *Name, const char *Value) +{ + // Parse your own setup parameters and store their values. + return xc.SetupParse(Name, Value); +} + +extern "C" +void *VDRPluginCreator(void) __attribute__((visibility("default"))); + +VDRPLUGINCREATOR(cPluginXinelibOutput); // Don't touch this! |