mirror of
https://github.com/videolan/vlc.git
synced 2024-12-05 07:46:32 +08:00
Remove unmaintained and outdated EyeTV support
This commit is contained in:
parent
c612f2431b
commit
d56a1e3440
1
NEWS
1
NEWS
@ -264,6 +264,7 @@ Removed modules
|
||||
* QuickTime decoder module (use native codecs)
|
||||
* BD access module (use libbluray)
|
||||
* Direct2D module (use Direct3D11)
|
||||
* EyeTV access module
|
||||
|
||||
|
||||
Changes between 2.2.0 and 2.2.1:
|
||||
|
10
configure.ac
10
configure.ac
@ -1991,16 +1991,6 @@ if test "${enable_realrtsp}" = "yes"; then
|
||||
VLC_ADD_PLUGIN([access_realrtsp])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl MacOS eyeTV
|
||||
AC_ARG_ENABLE(macosx-eyetv,
|
||||
[ --enable-macosx-eyetv Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
|
||||
if test "x${enable_macosx_eyetv}" != "xno" &&
|
||||
(test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
|
||||
then
|
||||
VLC_ADD_PLUGIN([access_eyetv])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl QTKit
|
||||
AC_ARG_ENABLE(macosx-qtkit,
|
||||
|
Binary file not shown.
@ -1,233 +0,0 @@
|
||||
/* This is public domain code developed by Elgato Systems GmbH. No GPL-covered
|
||||
* changes were added to this file by any members of the VideoLAN team. If you
|
||||
* want to do so, add a modified GPL header here, but keep a message emphasising
|
||||
* the non-licensed parts of this header file.
|
||||
* Ideally, VideoLAN-related changes should only go to eyetvplugin.h.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
|
||||
The EyeTV Plugin API
|
||||
====================
|
||||
|
||||
The EyeTV Software gives third parties access to the incoming MPEG-2 transport stream.
|
||||
At this time the API is available for the following products:
|
||||
|
||||
- EyeTV 200 (analog)
|
||||
- EyeTV 300 (DVB-S)
|
||||
- EyeTV 400 (DVB-T)
|
||||
|
||||
A plugin receives device plugged/unplugged notifications, it can request or release
|
||||
individual PIDs and most importantly it has access to transport stream packets in
|
||||
real time, as they arrive from the device. Note that the plugin is called before EyeTV
|
||||
itself looks at the packets, so it is even possible to modify the data.
|
||||
|
||||
Plugins currently live in EyeTV.app/Contens/Plugins/
|
||||
|
||||
A plugin is packaged as a bundle with a single entry point:
|
||||
|
||||
long EyeTVPluginDispatcher(EyeTVPluginSelector selector,
|
||||
void *refCon,
|
||||
EyeTVPluginDeviceID deviceID,
|
||||
long param1,
|
||||
long param2,
|
||||
long param3,
|
||||
long param4);
|
||||
|
||||
|
||||
PID Filtering
|
||||
=============
|
||||
|
||||
EyeTV employs both hardware and software PID filtering. A plugin's dispatch routine
|
||||
is called with the kEyeTVPluginSelector_PacketsArrived selector after the hardware
|
||||
PID filter (naturally) but prior to the software PID filter, so the plugin has access
|
||||
to all packets that are delivered by the hardware.
|
||||
|
||||
A plugin can request PIDs that are not needed by EyeTV from the hardware PID filter by
|
||||
means of a callback routine, see eyeTVPluginSelector_SetCallback.
|
||||
|
||||
Note that hardware PID filtering is on for single processor machines (to reduce the CPU
|
||||
load), but off for multi-processor machines (to improve channel switch times).
|
||||
This behaviour is controlled by the "hardware PID filter" key in com.elgato.eyetv.plist,
|
||||
which defaults to "Auto" ("Off" on MP machines, "On" on single-processor machines). EyeTV
|
||||
does not offer GUI to change this setting. A plugin hence needs to be prepared to handle
|
||||
both an entire transponder or multiplex and to request PIDs it might need.
|
||||
|
||||
Note that the plugin is called on the real-time thread that receives the transport stream
|
||||
packets and that the packet buffers passed to the plugin are the actual hardware DMA buffers.
|
||||
Please return as quickly as possible from the kEyeTVPluginSelector_PacketsArrived call and
|
||||
avoid blocking the calling thread.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Revision History:
|
||||
|
||||
02/27/2004: Initial Release.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#define EYETV_PLUGIN_API_VERSION 0x04021901
|
||||
#define EYETV_PLUGIN_API_MIN_VERSION 0x04021901
|
||||
|
||||
typedef long long EyeTVPluginDeviceID;
|
||||
typedef long EyeTVPluginDeviceType;
|
||||
typedef long EyeTVPluginSelector;
|
||||
|
||||
enum {
|
||||
kEyeTVPIDType_Video = 0,
|
||||
kEyeTVPIDType_MPEGAudio = 1,
|
||||
kEyeTVPIDType_VBI = 2, /* teletext */
|
||||
kEyeTVPIDType_PCR = 3,
|
||||
kEyeTVPIDType_PMT = 4,
|
||||
kEyeTVPIDType_Unknown = 5,
|
||||
kEyeTVPIDType_AC3Audio = 6
|
||||
};
|
||||
|
||||
|
||||
typedef struct EyeTVPluginPIDInfo EyeTVPluginPIDInfo;
|
||||
struct EyeTVPluginPIDInfo {
|
||||
long pid;
|
||||
long pidType;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***********************************************************************************
|
||||
*
|
||||
* EyeTVPluginCallbackParams,
|
||||
*
|
||||
***********************************************************************************/
|
||||
enum {
|
||||
kEyeTVPluginCallbackSelector_RetainPIDs = 0,
|
||||
kEyeTVPluginCallbackSelector_ReleasePIDs = 1
|
||||
};
|
||||
|
||||
typedef struct EyeTVPluginCallbackParams EyeTVPluginCallbackParams;
|
||||
struct EyeTVPluginCallbackParams {
|
||||
EyeTVPluginDeviceID deviceID; // the deviceID
|
||||
long selector; // callback selector, see above
|
||||
long *pids; // list of pids to release/retain
|
||||
long pidsCount; // count of pids
|
||||
};
|
||||
|
||||
|
||||
/***********************************************************************************
|
||||
*
|
||||
* typedef for the callback function,
|
||||
*
|
||||
***********************************************************************************/
|
||||
typedef long(* EyeTVPluginCallbackProc)(EyeTVPluginCallbackParams *params);
|
||||
|
||||
|
||||
|
||||
/***********************************************************************************
|
||||
*
|
||||
* EyeTVPluginParamStructs
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
|
||||
typedef struct EyeTVPluginInitializeParams EyeTVPluginInitializeParams;
|
||||
struct EyeTVPluginInitializeParams {
|
||||
long apiVersion; // version of the EyeTV_PLUGIN_API
|
||||
EyeTVPluginCallbackProc callback; // the callback
|
||||
}; /* 8 bytes */
|
||||
|
||||
|
||||
|
||||
typedef struct EyeTVPluginGetInfoParams EyeTVPluginGetInfoParams;
|
||||
struct EyeTVPluginGetInfoParams {
|
||||
long *pluginAPIVersion; // <- EYETV_PLUGIN_API_VERSION
|
||||
char *pluginName; // <- points to a 128-byte buffer, the plugin is expected to fill the buffer with
|
||||
// a UTF-8 encoded string.
|
||||
char *description; // <- points to a 1024-byte buffer, the plugin is expected to fill the buffer with
|
||||
// a UTF-8 encoded string describing the plugin.
|
||||
}; /* 12 bytes */
|
||||
|
||||
|
||||
|
||||
enum {
|
||||
kEyeTVPluginDeviceType_Unknown = 0,
|
||||
kEyeTVPluginDeviceType_e200 = 1,
|
||||
kEyeTVPluginDeviceType_e300 = 2,
|
||||
kEyeTVPluginDeviceType_e400 = 3
|
||||
} ;
|
||||
|
||||
typedef struct EyeTVPluginDeviceAddedParams EyeTVPluginDeviceAddedParams;
|
||||
struct EyeTVPluginDeviceAddedParams {
|
||||
EyeTVPluginDeviceType deviceType;
|
||||
}; /* 4 bytes */
|
||||
|
||||
|
||||
typedef struct EyeTVPluginPacketsArrivedParams EyeTVPluginPacketsArrivedParams;
|
||||
struct EyeTVPluginPacketsArrivedParams {
|
||||
long **packets; // points to an array of packets
|
||||
long packetCount;
|
||||
}; /* 8 bytes */
|
||||
|
||||
|
||||
|
||||
typedef struct EyeTVPluginServiceChangedParams EyeTVPluginServiceChangedParams;
|
||||
struct EyeTVPluginServiceChangedParams {
|
||||
long headendID; // new headend ID. For E300 it's the orbital position of the satellite
|
||||
// in tenth of a degree
|
||||
long transponderID; // new transponder ID (The Frequency in kHz)
|
||||
long serviceID; // new service ID (the ID of the used service as included in the DVB Stream)
|
||||
EyeTVPluginPIDInfo *pidList; // points to the list of active PIDs;
|
||||
long pidCount; // the length of pidList
|
||||
}; /* 20 bytes */
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************************************************************************
|
||||
*
|
||||
* EyeTVPluginParams
|
||||
*
|
||||
***********************************************************************************/
|
||||
typedef struct EyeTVPluginParams EyeTVPluginParams;
|
||||
struct EyeTVPluginParams {
|
||||
EyeTVPluginDeviceID deviceID; // ID of the device
|
||||
EyeTVPluginSelector selector; // selector
|
||||
void *refCon; // refCon
|
||||
|
||||
union {
|
||||
EyeTVPluginInitializeParams initialize; // kEyeTVPluginSelector_Initialize
|
||||
// kEyeTVPluginSelector_Terminate, no additional parameters
|
||||
EyeTVPluginGetInfoParams info; // kEyeTVPluginSelector_GetInfo
|
||||
EyeTVPluginDeviceAddedParams deviceAdded; // kEyeTVPluginSelector_DeviceAdded
|
||||
// kEyeTVPluginSelector_DeviceRemoved, no additional parameters
|
||||
EyeTVPluginPacketsArrivedParams packetsArrived; // kEyeTVPluginSelector_PacketsArrived
|
||||
EyeTVPluginServiceChangedParams serviceChanged; // kEyeTVPluginSelector_ServiceChanged
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
enum { // EyeTVPluginSelector
|
||||
kEyeTVPluginSelector_Initialize = 0,
|
||||
kEyeTVPluginSelector_Terminate = 1,
|
||||
kEyeTVPluginSelector_GetInfo = 2,
|
||||
kEyeTVPluginSelector_DeviceAdded = 3,
|
||||
kEyeTVPluginSelector_DeviceRemoved = 4,
|
||||
kEyeTVPluginSelector_PacketsArrived = 5,
|
||||
kEyeTVPluginSelector_ServiceChanged = 6
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***********************************************************************************
|
||||
*
|
||||
* EyeTVPluginEntryProc
|
||||
*
|
||||
***********************************************************************************/
|
||||
typedef long(* EyeTVPluginEntryProc)(EyeTVPluginParams *params);
|
@ -1 +0,0 @@
|
||||
<pkg-contents spec="1.12"><f n="VLC EyeTV Plug-In.bundle" o="" g="" p="0" pt="/Users/fpk/Desktop/vlc/extras/package/macosx/eyetvplugin/build/Release/VLC EyeTV Plug-In.bundle" m="false" t="file"/></pkg-contents>
|
@ -1 +0,0 @@
|
||||
<pkgref spec="1.12" uuid="DA869B40-5882-4E63-AA06-CD0C8DC06829"><config><identifier>org.videolan.vlcPluginForEyetv</identifier><version>1.5</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true" includeRoot="true">build/Release/VLC EyeTV Plug-In.bundle</installFrom><installTo mod="true" relocatable="true">/Applications/EyeTV.app/Contents/Plugins</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo</mod><mod>relocatable</mod><mod>installFrom.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod><mod>installTo.path</mod><mod>installFrom.isRelativeType</mod><mod>installFrom.isAbsoluteType</mod></config><contents><file-list>01vlc-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
|
@ -1,13 +0,0 @@
|
||||
<pkmkdoc spec="1.12"><properties><title>VLC Plugin for EyeTV</title><build>/Users/fpk/Desktop/VLC Plugin for EyeTV.pkg</build><organization>org.videolan</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="VLC EyeTV Plug-In" id="choice2" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.videolan.vlcPluginForEyetv"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"><resource relative="true" mod="true" type="license">../../../../COPYING</resource><resource mime-type="text/rtf" kind="embedded" type="readme"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320
|
||||
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
|
||||
|
||||
\f0\fs26 \cf0 This installer adds a plugin to your EyeTV installation to play and process TV streams with VLC.\
|
||||
\
|
||||
Please note that you might have to re-run this installer in case that you update your EyeTV installation.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="conclusion"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320
|
||||
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
|
||||
|
||||
\f0\fs26 \cf0 Please restart EyeTV to use the VLC plugin.}]]></resource></locale></resources><requirements><requirement id="filt" operator="eq" value="true"><file>/Applications/EyeTV.app</file><message>Please install EyeTV at its default location prior to installing this plugin.</message></requirement></requirements><flags/><item type="file">01vlc.xml</item><mod>properties.title</mod></pkmkdoc>
|
@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.videolan.vlceyetvplugin</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.1</string>
|
||||
<key>CFPlugInDynamicRegisterFunction</key>
|
||||
<string></string>
|
||||
<key>CFPlugInDynamicRegistration</key>
|
||||
<string>NO</string>
|
||||
<key>CFPlugInFactories</key>
|
||||
<dict>
|
||||
<key>00000000-0000-0000-0000-000000000000</key>
|
||||
<string>MyFactoryFunction</string>
|
||||
</dict>
|
||||
<key>CFPlugInTypes</key>
|
||||
<dict>
|
||||
<key>00000000-0000-0000-0000-000000000000</key>
|
||||
<array>
|
||||
<string>00000000-0000-0000-0000-000000000000</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>CFPlugInUnloadFunction</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
@ -1,498 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* eyetvplugin.c: Plug-In for the EyeTV software to connect to VLC
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2006-2007 the VideoLAN team
|
||||
* $Id$
|
||||
*
|
||||
* Authors: Felix Kühne <fkuehne at videolan dot org>
|
||||
*
|
||||
* 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.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "eyetvplugin.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#define MAX_PIDS 256
|
||||
#define MAX_ACTIVE_PIDS 256
|
||||
#define MAX_DEVICES 16
|
||||
#define VLC_NOTIFICATION_OBJECT "VLCEyeTVSupport"
|
||||
|
||||
#pragma push
|
||||
#pragma pack(1)
|
||||
|
||||
/* Structure for TS-Packets */
|
||||
typedef struct
|
||||
{
|
||||
uint32_t sync_byte : 8,
|
||||
transport_error_indicator : 1,
|
||||
payload_unit_start_indicator : 1,
|
||||
transport_priority : 1,
|
||||
PID : 13,
|
||||
transport_scrambling_control : 2,
|
||||
adaptation_field_control : 2,
|
||||
continuity_counter : 4;
|
||||
uint8_t payload[184];
|
||||
|
||||
} TransportStreamPacket;
|
||||
|
||||
#pragma pop
|
||||
|
||||
|
||||
/* Structure to hold global data to communicate with EyeTV */
|
||||
typedef struct
|
||||
{
|
||||
EyeTVPluginCallbackProc callback;
|
||||
/* Structure to hold current active service */
|
||||
EyeTVPluginDeviceID activeDeviceID;
|
||||
long activePIDsCount;
|
||||
EyeTVPluginPIDInfo activePIDs[MAX_ACTIVE_PIDS];
|
||||
} VLCEyeTVPluginGlobals_t;
|
||||
|
||||
/* following globals limits us to one VLC instance using EyeTV */
|
||||
static int i_deviceCount;
|
||||
static int i_vlcSock;
|
||||
|
||||
#pragma mark -
|
||||
|
||||
/* initialise the plug-in */
|
||||
static long VLCEyeTVPluginInitialize(VLCEyeTVPluginGlobals_t** globals, long apiVersion, EyeTVPluginCallbackProc callback)
|
||||
{
|
||||
printf("VLC media player Plug-In: Initialize\n");
|
||||
long result = 0;
|
||||
|
||||
/* init our own storage */
|
||||
i_deviceCount = 0;
|
||||
i_vlcSock = -1;
|
||||
|
||||
/* notify a potential VLC instance about our initialisation */
|
||||
CFNotificationCenterPostNotification( CFNotificationCenterGetDistributedCenter(),
|
||||
CFSTR("PluginInit"),
|
||||
CFSTR(VLC_NOTIFICATION_OBJECT),
|
||||
/*userInfo*/ NULL,
|
||||
TRUE );
|
||||
|
||||
/* init our notification support */
|
||||
CFNotificationCenterAddObserver( CFNotificationCenterGetDistributedCenter(),
|
||||
/* observer */ NULL,
|
||||
/* callBack */ VLCEyeTVPluginGlobalNotificationReceived,
|
||||
/* name, NULL==all */ NULL,
|
||||
CFSTR(VLC_NOTIFICATION_OBJECT),
|
||||
CFNotificationSuspensionBehaviorDeliverImmediately );
|
||||
|
||||
*globals = (VLCEyeTVPluginGlobals_t *) calloc(1, sizeof( VLCEyeTVPluginGlobals_t ) );
|
||||
( *globals )->callback = callback;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* we will be terminated soon, clean up */
|
||||
static long VLCEyeTVPluginTerminate(VLCEyeTVPluginGlobals_t *globals)
|
||||
{
|
||||
long result = 0;
|
||||
|
||||
printf("VLC media player Plug-In: Terminate\n");
|
||||
|
||||
/* notify a potential VLC instance about our termination */
|
||||
CFNotificationCenterPostNotification( CFNotificationCenterGetDistributedCenter (),
|
||||
CFSTR("PluginQuit"),
|
||||
CFSTR(VLC_NOTIFICATION_OBJECT),
|
||||
/*userInfo*/ NULL,
|
||||
TRUE );
|
||||
|
||||
/* remove us from the global notification centre */
|
||||
CFNotificationCenterRemoveEveryObserver( CFNotificationCenterGetDistributedCenter(),
|
||||
(void *)VLCEyeTVPluginGlobalNotificationReceived );
|
||||
|
||||
/* close data connection */
|
||||
if( i_vlcSock != -1 )
|
||||
{
|
||||
close( i_vlcSock );
|
||||
i_vlcSock = -1;
|
||||
}
|
||||
|
||||
free( globals );
|
||||
return result;
|
||||
}
|
||||
|
||||
/* called when EyeTV asks various stuff about us */
|
||||
static long VLCEyeTVPluginGetInformation(VLCEyeTVPluginGlobals_t *globals, long* outAPIVersion, char* outName, char *outDescription)
|
||||
{
|
||||
printf("VLC media player Plug-In: GetInfo\n");
|
||||
long result = 0;
|
||||
|
||||
if( globals )
|
||||
{
|
||||
if( outAPIVersion )
|
||||
{
|
||||
*outAPIVersion = EYETV_PLUGIN_API_VERSION;
|
||||
}
|
||||
|
||||
if( outName )
|
||||
{
|
||||
strcpy( outName, "VLC media player Plug-In");
|
||||
}
|
||||
|
||||
if( outDescription )
|
||||
{
|
||||
strcpy( outDescription, "This Plug-In connects EyeTV to the VLC media player for streaming purposes.");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* called if we received a global notification */
|
||||
void VLCEyeTVPluginGlobalNotificationReceived( CFNotificationCenterRef center,
|
||||
void *observer,
|
||||
CFStringRef name,
|
||||
const void *object,
|
||||
CFDictionaryRef userInfo )
|
||||
{
|
||||
/* when VLC launches after us, we need to inform it about our existance and the current state of available devices */
|
||||
if( CFStringCompare( name, CFSTR( "VLCOSXGUIInit" ), 0) == kCFCompareEqualTo )
|
||||
{
|
||||
/* we're here */
|
||||
CFNotificationCenterPostNotification( CFNotificationCenterGetDistributedCenter (),
|
||||
CFSTR("PluginInit"),
|
||||
CFSTR(VLC_NOTIFICATION_OBJECT),
|
||||
/*userInfo*/ NULL,
|
||||
TRUE );
|
||||
if( i_deviceCount > 0 )
|
||||
{
|
||||
/* at least one device is apparently connected */
|
||||
CFNotificationCenterPostNotification( CFNotificationCenterGetDistributedCenter (),
|
||||
CFSTR("DeviceAdded"),
|
||||
CFSTR(VLC_NOTIFICATION_OBJECT),
|
||||
/*userInfo*/ NULL,
|
||||
TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
/* VLC wants us to start sending data */
|
||||
if( CFStringCompare( name, CFSTR( "VLCAccessStartDataSending" ), 0) == kCFCompareEqualTo )
|
||||
{
|
||||
if( i_vlcSock == -1 )
|
||||
{
|
||||
int peerSock;
|
||||
|
||||
/* set-up data socket */
|
||||
peerSock = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if( peerSock != -1 )
|
||||
{
|
||||
struct sockaddr_un peerAddr;
|
||||
/* set-up connection address */
|
||||
memset(&peerAddr, 0, sizeof(peerAddr));
|
||||
peerAddr.sun_family = AF_UNIX;
|
||||
strncpy(peerAddr.sun_path, "/tmp/.vlc-eyetv-bridge", sizeof(peerAddr.sun_path)-1);
|
||||
|
||||
/* connect */
|
||||
printf("data connect in progess...\n");
|
||||
if( connect(peerSock, (struct sockaddr *)&peerAddr, sizeof(struct sockaddr_un)) != -1 )
|
||||
{
|
||||
printf("data sending switched on\n");
|
||||
|
||||
i_vlcSock = peerSock;
|
||||
}
|
||||
else
|
||||
printf("connect data socket failed (errno=%d)\n", errno );
|
||||
}
|
||||
else
|
||||
printf("create data socket failed (errno=%d)\n", errno );
|
||||
}
|
||||
}
|
||||
|
||||
/* VLC wants us to stop sending data */
|
||||
if( CFStringCompare( name, CFSTR( "VLCAccessStopDataSending" ), 0) == kCFCompareEqualTo )
|
||||
{
|
||||
if( i_vlcSock != -1 )
|
||||
{
|
||||
close( i_vlcSock );
|
||||
i_vlcSock = -1;
|
||||
printf( "data sending switched off\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* called if a device is added */
|
||||
static long VLCEyeTVPluginDeviceAdded(VLCEyeTVPluginGlobals_t *globals, EyeTVPluginDeviceID deviceID, EyeTVPluginDeviceType deviceType)
|
||||
{
|
||||
printf("VLC media player Plug-In: Device with type %i and ID %i added\n", (int)deviceType, (int)deviceID);
|
||||
|
||||
long result = 0;
|
||||
|
||||
if( globals )
|
||||
{
|
||||
++i_deviceCount;
|
||||
if( 1 == i_deviceCount )
|
||||
{
|
||||
/* notify a potential VLC instance about the addition */
|
||||
CFNotificationCenterPostNotification( CFNotificationCenterGetDistributedCenter(),
|
||||
CFSTR("DeviceAdded"),
|
||||
CFSTR(VLC_NOTIFICATION_OBJECT),
|
||||
/*userInfo*/ NULL,
|
||||
TRUE );
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* called if a device is removed */
|
||||
static long VLCEyeTVPluginDeviceRemoved(VLCEyeTVPluginGlobals_t *globals, EyeTVPluginDeviceID deviceID)
|
||||
{
|
||||
printf("VLC media player Plug-In: DeviceRemoved\n");
|
||||
|
||||
long result = 0;
|
||||
|
||||
--i_deviceCount;
|
||||
if( 0 == i_deviceCount )
|
||||
{
|
||||
/* notify a potential VLC instance about the removal */
|
||||
CFNotificationCenterPostNotification( CFNotificationCenterGetDistributedCenter(),
|
||||
CFSTR("DeviceRemoved"),
|
||||
CFSTR(VLC_NOTIFICATION_OBJECT),
|
||||
/*userInfo*/ NULL,
|
||||
TRUE );
|
||||
}
|
||||
if( (i_vlcSock != -1) && (deviceID == globals->activeDeviceID) )
|
||||
{
|
||||
close(i_vlcSock);
|
||||
i_vlcSock = -1;
|
||||
printf( "data sending switched off\n" );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* This function is called, whenever packets are received by EyeTV. For reasons of performance,
|
||||
* the data is the original data, not a copy. That means, EyeTV waits until this method is
|
||||
* finished. Therefore all in this method should be as fast as possible. */
|
||||
static long VLCEyeTVPluginPacketsArrived(VLCEyeTVPluginGlobals_t *globals, EyeTVPluginDeviceID deviceID, long **packets, long packetsCount)
|
||||
{
|
||||
if( globals )
|
||||
{
|
||||
/* check if data connection is active */
|
||||
if( i_vlcSock != -1 )
|
||||
{
|
||||
if( deviceID == globals->activeDeviceID )
|
||||
{
|
||||
long pidCount = globals->activePIDsCount;
|
||||
if( pidCount )
|
||||
{
|
||||
uint8_t packetBuffer[sizeof(TransportStreamPacket)*20];
|
||||
int packetBufferSize = 0;
|
||||
while( packetsCount )
|
||||
{
|
||||
/* apply PID filtering, only PIDs in active service for device are sent through */
|
||||
long pid = ntohl(**packets)>>8 & 0x1FFFL;
|
||||
/* ignore NULL packets */
|
||||
if( 0x1FFFL != pid )
|
||||
{
|
||||
long i;
|
||||
for( i=0; i<pidCount; ++i )
|
||||
{
|
||||
if( globals->activePIDs[i].pid == pid )
|
||||
{
|
||||
memcpy(packetBuffer+packetBufferSize, *packets, sizeof(TransportStreamPacket));
|
||||
packetBufferSize += sizeof(TransportStreamPacket);
|
||||
if( packetBufferSize > (sizeof(packetBuffer)-sizeof(TransportStreamPacket)) )
|
||||
{
|
||||
/* flush buffer to VLC */
|
||||
ssize_t sent = write(i_vlcSock, packetBuffer, packetBufferSize);
|
||||
if( sent != packetBufferSize )
|
||||
{
|
||||
if( sent == -1 )
|
||||
printf("data sending failed (errno=%d)\n", errno);
|
||||
else
|
||||
printf("data sending incomplete (sent=%zd)\n", sent);
|
||||
close(i_vlcSock);
|
||||
i_vlcSock = -1;
|
||||
return 0;
|
||||
}
|
||||
packetBufferSize = 0;
|
||||
}
|
||||
|
||||
if( i > 0 )
|
||||
{
|
||||
/* if we assume that consecutive packets would have the same PID in most cases,
|
||||
it would therefore speed up filtering to reorder activePIDs list based on pid
|
||||
occurrences */
|
||||
EyeTVPluginPIDInfo swap = globals->activePIDs[i];
|
||||
do
|
||||
{
|
||||
register int c = i--;
|
||||
globals->activePIDs[c] = globals->activePIDs[i];
|
||||
}
|
||||
while( i );
|
||||
globals->activePIDs[i] = swap;
|
||||
}
|
||||
|
||||
if( pid && globals->activePIDs[0].pidType != kEyeTVPIDType_PMT )
|
||||
{
|
||||
/* to save on CPU, prevent EyeTV from mirroring that program by blocking video & audio packets
|
||||
by changing all packets but PAT and PMT to NULL PID */
|
||||
#if defined(WORDS_BIGENDIAN)
|
||||
**packets |= 0x001FFF00L;
|
||||
#else
|
||||
**packets |= 0x00FFF800L;
|
||||
#endif
|
||||
}
|
||||
/* done filtering on this packet, move on to next packet */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
--packetsCount;
|
||||
++packets;
|
||||
}
|
||||
if( packetBufferSize )
|
||||
{
|
||||
/* flush buffer to VLC */
|
||||
ssize_t sent = write(i_vlcSock, packetBuffer, packetBufferSize);
|
||||
if( sent != packetBufferSize )
|
||||
{
|
||||
if( sent == -1 )
|
||||
printf("data sending failed (errno=%d)\n", errno);
|
||||
else
|
||||
printf("data sending incomplete (sent=%zd)\n", sent);
|
||||
close(i_vlcSock);
|
||||
i_vlcSock = -1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* VLCEyeTVPluginServiceChanged,
|
||||
*
|
||||
* - *globals : The plug-in Globals
|
||||
* - deviceID : Identifies the active Device
|
||||
* - headendID : The HeadendID, for e300 it's the orbital position of the satelite in
|
||||
* tenth degrees east
|
||||
* - transponderID : The Frequency in kHz
|
||||
* - serviceID : original ServiceID from the DVB-Stream (e300, e400)
|
||||
* - pidList : List of active PIDs
|
||||
*
|
||||
* Whenever a service changes, this function is called. Service-related plug-in data should be updated here.
|
||||
*/
|
||||
static long VLCEyeTVPluginServiceChanged(VLCEyeTVPluginGlobals_t *globals,
|
||||
EyeTVPluginDeviceID deviceID,
|
||||
long headendID,
|
||||
long transponderID,
|
||||
long serviceID,
|
||||
EyeTVPluginPIDInfo *pidList,
|
||||
long pidsCount)
|
||||
{
|
||||
long result = 0;
|
||||
int i;
|
||||
|
||||
printf("\nVLC media player Plug-In: ServiceChanged:\n");
|
||||
printf( "=====================================\n");
|
||||
|
||||
if( globals )
|
||||
{
|
||||
printf("DeviceID: %ld, ", (long)deviceID);
|
||||
printf("HeadendID: %ld, ", headendID);
|
||||
printf("TransponderID: %ld, ", transponderID);
|
||||
printf("ServiceID: %ld\n\n", serviceID);
|
||||
|
||||
globals->activeDeviceID = deviceID;
|
||||
globals->activePIDsCount = pidsCount;
|
||||
|
||||
/* need active PIDs for packet filtering */
|
||||
for( i = 0; i < pidsCount; i++ )
|
||||
{
|
||||
globals->activePIDs[i] = pidList[i];
|
||||
printf("Active PID: %ld, type: %ld\n", pidList[i].pid, pidList[i].pidType);
|
||||
}
|
||||
}
|
||||
printf( "=====================================\n");
|
||||
|
||||
/* notify a potential VLC instance about the service change */
|
||||
CFNotificationCenterPostNotification( CFNotificationCenterGetDistributedCenter(),
|
||||
CFSTR("ServiceChanged"),
|
||||
CFSTR(VLC_NOTIFICATION_OBJECT),
|
||||
/*userInfo*/ NULL,
|
||||
TRUE );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
/* EyeTVPluginDispatcher,
|
||||
*
|
||||
* - selector : See 'EyeTVPluginDefs.h'
|
||||
* - *refCon : The RefCon to the plug-in-related Data
|
||||
* - deviceID : Identifies the Device
|
||||
* - params : Parameters for functioncall
|
||||
*
|
||||
* This function is a part of the interface for the communication with EyeTV. If something happens,
|
||||
* EyeTV thinks, we should know of, it calls this function with the corresponding selector. */
|
||||
|
||||
#pragma export on
|
||||
|
||||
long EyeTVPluginDispatcher( EyeTVPluginParams* params )
|
||||
{
|
||||
long result = 0;
|
||||
|
||||
switch( params->selector )
|
||||
{
|
||||
case kEyeTVPluginSelector_Initialize:
|
||||
result = VLCEyeTVPluginInitialize((VLCEyeTVPluginGlobals_t**)params->refCon,
|
||||
params->initialize.apiVersion, params->initialize.callback);
|
||||
break;
|
||||
|
||||
case kEyeTVPluginSelector_Terminate:
|
||||
result = VLCEyeTVPluginTerminate((VLCEyeTVPluginGlobals_t*)params->refCon);
|
||||
break;
|
||||
|
||||
case kEyeTVPluginSelector_GetInfo:
|
||||
result = VLCEyeTVPluginGetInformation((VLCEyeTVPluginGlobals_t*)params->refCon,
|
||||
params->info.pluginAPIVersion, params->info.pluginName, params->info.description);
|
||||
break;
|
||||
|
||||
case kEyeTVPluginSelector_DeviceAdded:
|
||||
result = VLCEyeTVPluginDeviceAdded((VLCEyeTVPluginGlobals_t*)params->refCon,
|
||||
params->deviceID, params->deviceAdded.deviceType);
|
||||
break;
|
||||
|
||||
case kEyeTVPluginSelector_DeviceRemoved:
|
||||
result = VLCEyeTVPluginDeviceRemoved((VLCEyeTVPluginGlobals_t*)params->refCon, params->deviceID);
|
||||
break;
|
||||
|
||||
case kEyeTVPluginSelector_PacketsArrived:
|
||||
result = VLCEyeTVPluginPacketsArrived((VLCEyeTVPluginGlobals_t*)params->refCon, params->deviceID,
|
||||
params->packetsArrived.packets, params->packetsArrived.packetCount);
|
||||
break;
|
||||
|
||||
case kEyeTVPluginSelector_ServiceChanged:
|
||||
result = VLCEyeTVPluginServiceChanged((VLCEyeTVPluginGlobals_t*)params->refCon,
|
||||
params->deviceID, params->serviceChanged.headendID,
|
||||
params->serviceChanged.transponderID, params->serviceChanged.serviceID,
|
||||
params->serviceChanged.pidList, params->serviceChanged.pidCount);
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* eyetvplugin.h: Plug-In for the EyeTV software to connect to VLC
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2006-2007 the VideoLAN team
|
||||
* $Id$
|
||||
*
|
||||
* Authors: Felix Kühne <fkuehne at videolan dot org>
|
||||
*
|
||||
* 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.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "EyeTVPluginDefs.h"
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
void VLCEyeTVPluginGlobalNotificationReceived( CFNotificationCenterRef center,
|
||||
void *observer,
|
||||
CFStringRef name,
|
||||
const void *object,
|
||||
CFDictionaryRef userInfo );
|
@ -1,254 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8D576314048677EA00EA77CD /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */; };
|
||||
8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8D5B49A704867FD3000E48DA /* InfoPlist.strings */; };
|
||||
CC09359B0AE11E6A00647FD0 /* eyetvplugin.c in Sources */ = {isa = PBXBuildFile; fileRef = CC09359A0AE11E6A00647FD0 /* eyetvplugin.c */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
|
||||
8D576316048677EA00EA77CD /* VLC EyeTV Plug-In.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "VLC EyeTV Plug-In.bundle"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8D576317048677EA00EA77CD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
CC09359A0AE11E6A00647FD0 /* eyetvplugin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = eyetvplugin.c; sourceTree = "<group>"; };
|
||||
CC09359C0AE11E7900647FD0 /* EyeTVPluginDefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EyeTVPluginDefs.h; sourceTree = "<group>"; };
|
||||
CC3AE2920AE2E4EE00ACC87C /* eyetvplugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eyetvplugin.h; sourceTree = "<group>"; };
|
||||
CC74BC500AE2714300AD738B /* eyetv.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = eyetv.m; path = ../../../../modules/access/eyetv.m; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8D576313048677EA00EA77CD /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D576314048677EA00EA77CD /* CoreFoundation.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
089C166AFE841209C02AAC07 /* VLC EyeTV Plug-In */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC74BC530AE2715100AD738B /* access module */,
|
||||
08FB77AFFE84173DC02AAC07 /* Source */,
|
||||
089C167CFE841241C02AAC07 /* Resources */,
|
||||
089C1671FE841209C02AAC07 /* External Frameworks and Libraries */,
|
||||
19C28FB6FE9D52B211CA2CBB /* Products */,
|
||||
);
|
||||
name = "VLC EyeTV Plug-In";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */,
|
||||
);
|
||||
name = "External Frameworks and Libraries";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
089C167CFE841241C02AAC07 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D576317048677EA00EA77CD /* Info.plist */,
|
||||
8D5B49A704867FD3000E48DA /* InfoPlist.strings */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
08FB77AFFE84173DC02AAC07 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC3AE2920AE2E4EE00ACC87C /* eyetvplugin.h */,
|
||||
CC09359A0AE11E6A00647FD0 /* eyetvplugin.c */,
|
||||
CC09359C0AE11E7900647FD0 /* EyeTVPluginDefs.h */,
|
||||
);
|
||||
name = Source;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
19C28FB6FE9D52B211CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D576316048677EA00EA77CD /* VLC EyeTV Plug-In.bundle */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC74BC530AE2715100AD738B /* access module */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC74BC500AE2714300AD738B /* eyetv.m */,
|
||||
);
|
||||
name = "access module";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8D57630D048677EA00EA77CD /* VLC EyeTV Plug-In */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1DEB911A08733D790010E9CD /* Build configuration list for PBXNativeTarget "VLC EyeTV Plug-In" */;
|
||||
buildPhases = (
|
||||
8D57630F048677EA00EA77CD /* Resources */,
|
||||
8D576311048677EA00EA77CD /* Sources */,
|
||||
8D576313048677EA00EA77CD /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "VLC EyeTV Plug-In";
|
||||
productInstallPath = "$(HOME)/Library/Bundles";
|
||||
productName = "VLC EyeTV Plug-In";
|
||||
productReference = 8D576316048677EA00EA77CD /* VLC EyeTV Plug-In.bundle */;
|
||||
productType = "com.apple.product-type.bundle";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
089C1669FE841209C02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
ORGANIZATIONNAME = VideoLAN;
|
||||
};
|
||||
buildConfigurationList = 1DEB911E08733D790010E9CD /* Build configuration list for PBXProject "eyetvplugin" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 1;
|
||||
knownRegions = (
|
||||
English,
|
||||
Japanese,
|
||||
French,
|
||||
German,
|
||||
);
|
||||
mainGroup = 089C166AFE841209C02AAC07 /* VLC EyeTV Plug-In */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8D57630D048677EA00EA77CD /* VLC EyeTV Plug-In */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8D57630F048677EA00EA77CD /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8D576311048677EA00EA77CD /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CC09359B0AE11E6A00647FD0 /* eyetvplugin.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
8D5B49A704867FD3000E48DA /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
089C167EFE841241C02AAC07 /* English */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1DEB911B08733D790010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = "compiler-default";
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Library/Bundles";
|
||||
PRODUCT_NAME = "VLC EyeTV Plug-In";
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
ZERO_LINK = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB911C08733D790010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
x86_64,
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Library/Bundles";
|
||||
PRODUCT_NAME = "VLC EyeTV Plug-In";
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1DEB911F08733D790010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = macosx10.5;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB912008733D790010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = macosx10.5;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1DEB911A08733D790010E9CD /* Build configuration list for PBXNativeTarget "VLC EyeTV Plug-In" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB911B08733D790010E9CD /* Debug */,
|
||||
1DEB911C08733D790010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
1DEB911E08733D790010E9CD /* Build configuration list for PBXProject "eyetvplugin" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB911F08733D790010E9CD /* Debug */,
|
||||
1DEB912008733D790010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 089C1669FE841209C02AAC07 /* Project object */;
|
||||
}
|
@ -125,15 +125,6 @@ EXTRA_DIST += \
|
||||
extras/package/macosx/codesign.sh \
|
||||
extras/package/macosx/configure.sh \
|
||||
extras/package/macosx/dmg_setup.scpt \
|
||||
extras/package/macosx/eyetvplugin/English.lproj/InfoPlist.strings \
|
||||
extras/package/macosx/eyetvplugin/EyeTV_Plugin_Installer.pmdoc/01vlc-contents.xml \
|
||||
extras/package/macosx/eyetvplugin/EyeTV_Plugin_Installer.pmdoc/01vlc.xml \
|
||||
extras/package/macosx/eyetvplugin/EyeTV_Plugin_Installer.pmdoc/index.xml \
|
||||
extras/package/macosx/eyetvplugin/eyetvplugin.c \
|
||||
extras/package/macosx/eyetvplugin/eyetvplugin.h \
|
||||
extras/package/macosx/eyetvplugin/eyetvplugin.xcodeproj/project.pbxproj \
|
||||
extras/package/macosx/eyetvplugin/EyeTVPluginDefs.h \
|
||||
extras/package/macosx/eyetvplugin/Info.plist \
|
||||
extras/package/macosx/fullscreen_panel.svg \
|
||||
extras/package/macosx/vlc_status_icon.svg \
|
||||
extras/package/macosx/Info.plist.in \
|
||||
|
@ -340,13 +340,6 @@ libdvb_plugin_la_LIBADD = $(DVBPSI_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
libaccess_eyetv_plugin_la_SOURCES = access/eyetv.m
|
||||
libaccess_eyetv_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(accessdir)' \
|
||||
-Wl,-framework,Foundation
|
||||
access_LTLIBRARIES += $(LTLIBaccess_eyetv)
|
||||
EXTRA_LTLIBRARIES += libaccess_eyetv_plugin.la
|
||||
|
||||
|
||||
### Network streams ###
|
||||
|
||||
libftp_plugin_la_SOURCES = access/ftp.c
|
||||
|
@ -1,305 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* eyetv.m : Access module to connect to our plugin running within EyeTV
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2006-2007 VLC authors and VideoLAN
|
||||
* $Id$
|
||||
*
|
||||
* Author: Felix Kühne <fkuehne at videolan dot org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser 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.
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Preamble
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <vlc_common.h>
|
||||
#include <vlc_plugin.h>
|
||||
#include <vlc_access.h>
|
||||
|
||||
#include <vlc_network.h>
|
||||
#include <vlc_interrupt.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#define MTU 65535
|
||||
|
||||
/* TODO:
|
||||
* watch for PluginQuit or DeviceRemoved to stop output to VLC's core then */
|
||||
|
||||
/*****************************************************************************
|
||||
* Module descriptior
|
||||
*****************************************************************************/
|
||||
static int Open (vlc_object_t *);
|
||||
static void Close(vlc_object_t *);
|
||||
|
||||
#define CHANNEL_TEXT N_("Channel number")
|
||||
#define CHANNEL_LONGTEXT N_(\
|
||||
"EyeTV program number, or use 0 for last channel, " \
|
||||
"-1 for S-Video input, -2 for Composite input")
|
||||
|
||||
vlc_module_begin ()
|
||||
set_shortname("EyeTV")
|
||||
set_description(N_("EyeTV input"))
|
||||
set_category(CAT_INPUT)
|
||||
set_subcategory(SUBCAT_INPUT_ACCESS)
|
||||
|
||||
add_integer("eyetv-channel", 0,
|
||||
CHANNEL_TEXT, CHANNEL_LONGTEXT, false)
|
||||
|
||||
set_capability("access", 0)
|
||||
add_shortcut("eyetv")
|
||||
set_callbacks(Open, Close)
|
||||
vlc_module_end ()
|
||||
|
||||
/*****************************************************************************
|
||||
* Access: local prototypes
|
||||
*****************************************************************************/
|
||||
struct access_sys_t
|
||||
{
|
||||
int eyetvSock;
|
||||
};
|
||||
|
||||
static block_t *BlockRead(access_t *, bool *);
|
||||
static int Control(access_t *, int, va_list);
|
||||
|
||||
static void selectChannel(vlc_object_t *p_this, int theChannelNum)
|
||||
{
|
||||
@autoreleasepool {
|
||||
NSAppleScript *script;
|
||||
switch(theChannelNum) {
|
||||
case -2: // Composite
|
||||
script = [[NSAppleScript alloc] initWithSource:
|
||||
@"tell application \"EyeTV\"\n"
|
||||
" input_change input source composite video input\n"
|
||||
" volume_change level 0\n"
|
||||
" show player_window\n"
|
||||
" tell application \"System Events\" to set visible of process \"EyeTV\" to false\n"
|
||||
"end tell"];
|
||||
break;
|
||||
case -1: // S-Video
|
||||
script = [[NSAppleScript alloc] initWithSource:
|
||||
@"tell application \"EyeTV\"\n"
|
||||
" input_change input source S video input\n"
|
||||
" volume_change level 0\n"
|
||||
" show player_window\n"
|
||||
" tell application \"System Events\" to set visible of process \"EyeTV\" to false\n"
|
||||
"end tell"];
|
||||
break;
|
||||
case 0: // Last
|
||||
script = [[NSAppleScript alloc] initWithSource:
|
||||
@"tell application \"EyeTV\"\n"
|
||||
" volume_change level 0\n"
|
||||
" show player_window\n"
|
||||
" tell application \"System Events\" to set visible of process \"EyeTV\" to false\n"
|
||||
"end tell"];
|
||||
break;
|
||||
default:
|
||||
if (theChannelNum > 0) {
|
||||
NSString *channel_change = [NSString stringWithFormat:
|
||||
@"tell application \"EyeTV\"\n"
|
||||
" channel_change channel number %d\n"
|
||||
" volume_change level 0\n"
|
||||
" show player_window\n"
|
||||
" tell application \"System Events\" to set visible of process \"EyeTV\" to false\n"
|
||||
"end tell", theChannelNum];
|
||||
script = [[NSAppleScript alloc] initWithSource:channel_change];
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
NSDictionary *errorDict;
|
||||
NSAppleEventDescriptor *descriptor = [script executeAndReturnError:&errorDict];
|
||||
if (nil == descriptor) {
|
||||
NSString *errorString = [errorDict objectForKey:NSAppleScriptErrorMessage];
|
||||
msg_Err(p_this, "EyeTV source change failed with error status '%s'", [errorString UTF8String]);
|
||||
}
|
||||
[script release];
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Open: sets up the module and its threads
|
||||
*****************************************************************************/
|
||||
static int Open(vlc_object_t *p_this)
|
||||
{
|
||||
access_t *p_access = (access_t *)p_this;
|
||||
access_sys_t *p_sys;
|
||||
|
||||
struct sockaddr_un publicAddr, peerAddr;
|
||||
int publicSock;
|
||||
|
||||
/* Init p_access */
|
||||
ACCESS_SET_CALLBACKS(NULL, BlockRead, Control, NULL);
|
||||
p_sys = p_access->p_sys = calloc(1, sizeof(access_sys_t));
|
||||
if (!p_sys)
|
||||
return VLC_ENOMEM;
|
||||
|
||||
msg_Dbg(p_access, "coming up");
|
||||
selectChannel(p_this, var_InheritInteger(p_access, "eyetv-channel"));
|
||||
|
||||
/* socket */
|
||||
memset(&publicAddr, 0, sizeof(publicAddr));
|
||||
publicAddr.sun_family = AF_UNIX;
|
||||
strncpy(publicAddr.sun_path, "/tmp/.vlc-eyetv-bridge", sizeof(publicAddr.sun_path)-1);
|
||||
/* remove previous public path if it wasn't cleanly removed */
|
||||
if ((0 != unlink(publicAddr.sun_path)) && (ENOENT != errno)) {
|
||||
msg_Err(p_access, "local socket path is not usable (errno=%d)", errno);
|
||||
free(p_sys);
|
||||
return VLC_EGENERIC;
|
||||
}
|
||||
|
||||
publicSock = vlc_socket(PF_UNIX, SOCK_STREAM, 0, false);
|
||||
if (publicSock == -1) {
|
||||
msg_Err(p_access, "create local socket failed (errno=%d)", errno);
|
||||
free(p_sys);
|
||||
return VLC_EGENERIC;
|
||||
}
|
||||
|
||||
if (bind(publicSock, (struct sockaddr *)&publicAddr, sizeof(struct sockaddr_un)) == -1) {
|
||||
msg_Err(p_access, "bind local socket failed (errno=%d)", errno);
|
||||
vlc_close(publicSock);
|
||||
free(p_sys);
|
||||
return VLC_EGENERIC;
|
||||
}
|
||||
|
||||
/* we are not expecting more than one connection */
|
||||
if (listen(publicSock, 1) == -1) {
|
||||
msg_Err(p_access, "cannot accept connection (errno=%d)", errno);
|
||||
vlc_close(publicSock);
|
||||
free(p_sys);
|
||||
return VLC_EGENERIC;
|
||||
} else {
|
||||
socklen_t peerSockLen = sizeof(struct sockaddr_un);
|
||||
int peerSock;
|
||||
|
||||
/* tell the EyeTV plugin to open start sending */
|
||||
CFNotificationCenterPostNotification(CFNotificationCenterGetDistributedCenter (),
|
||||
CFSTR("VLCAccessStartDataSending"),
|
||||
CFSTR("VLCEyeTVSupport"),
|
||||
/*userInfo*/ NULL,
|
||||
TRUE);
|
||||
|
||||
msg_Dbg(p_access, "plugin notified");
|
||||
|
||||
peerSock = accept(publicSock, (struct sockaddr *)&peerAddr, &peerSockLen);
|
||||
if (peerSock == -1) {
|
||||
msg_Err(p_access, "cannot wait for connection (errno=%d)", errno);
|
||||
vlc_close(publicSock);
|
||||
free(p_sys);
|
||||
return VLC_EGENERIC;
|
||||
}
|
||||
|
||||
msg_Dbg(p_access, "plugin connected");
|
||||
|
||||
p_sys->eyetvSock = peerSock;
|
||||
|
||||
/* remove public access */
|
||||
vlc_close(publicSock);
|
||||
unlink(publicAddr.sun_path);
|
||||
}
|
||||
return VLC_SUCCESS;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Close: closes msg-port, free resources
|
||||
*****************************************************************************/
|
||||
static void Close(vlc_object_t *p_this)
|
||||
{
|
||||
access_t *p_access = (access_t *)p_this;
|
||||
access_sys_t *p_sys = p_access->p_sys;
|
||||
|
||||
msg_Dbg(p_access, "closing");
|
||||
|
||||
/* tell the EyeTV plugin to close its msg port and stop sending */
|
||||
CFNotificationCenterPostNotification(CFNotificationCenterGetDistributedCenter (),
|
||||
CFSTR("VLCAccessStopDataSending"),
|
||||
CFSTR("VLCEyeTVSupport"),
|
||||
/*userInfo*/ NULL,
|
||||
TRUE);
|
||||
msg_Dbg(p_access, "plugin notified");
|
||||
|
||||
vlc_close(p_sys->eyetvSock);
|
||||
msg_Dbg(p_access, "msg port closed and freed");
|
||||
|
||||
free(p_sys);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* BlockRead: forwarding data from EyeTV plugin which was received above
|
||||
*****************************************************************************/
|
||||
static block_t *BlockRead(access_t *p_access, bool *restrict eof)
|
||||
{
|
||||
access_sys_t *p_sys = p_access->p_sys;
|
||||
block_t *p_block;
|
||||
ssize_t len;
|
||||
|
||||
(void) eof;
|
||||
|
||||
/* Read data */
|
||||
p_block = block_Alloc(MTU);
|
||||
len = vlc_read_i11e(p_sys->eyetvSock, p_block->p_buffer, MTU);
|
||||
|
||||
if (len < 0) {
|
||||
block_Release(p_block);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return block_Realloc(p_block, 0, p_block->i_buffer = len);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Control:
|
||||
*****************************************************************************/
|
||||
static int Control(access_t *p_access, int i_query, va_list args)
|
||||
{
|
||||
bool *pb_bool;
|
||||
int *pi_int;
|
||||
int64_t *pi_64;
|
||||
access_sys_t *p_sys = (access_sys_t *) p_access->p_sys;
|
||||
|
||||
switch(i_query) {
|
||||
case STREAM_CAN_SEEK:
|
||||
case STREAM_CAN_FASTSEEK:
|
||||
pb_bool = (bool*)va_arg(args, bool*);
|
||||
*pb_bool = false;
|
||||
break;
|
||||
case STREAM_CAN_PAUSE:
|
||||
pb_bool = (bool*)va_arg(args, bool*);
|
||||
*pb_bool = false;
|
||||
break;
|
||||
case STREAM_CAN_CONTROL_PACE:
|
||||
pb_bool = (bool*)va_arg(args, bool*);
|
||||
*pb_bool = false;
|
||||
break;
|
||||
case STREAM_GET_PTS_DELAY:
|
||||
pi_64 = (int64_t*)va_arg(args, int64_t *);
|
||||
*pi_64 =
|
||||
INT64_C(1000) * var_InheritInteger(p_access, "live-caching");
|
||||
break;
|
||||
default:
|
||||
return VLC_EGENERIC;
|
||||
}
|
||||
return VLC_SUCCESS;
|
||||
}
|
Loading…
Reference in New Issue
Block a user