[MPlayer-dev-eng] [PATCH] Apple Remote support

Diego Biurrun diego at biurrun.de
Fri Aug 10 20:19:57 CEST 2007


On Fri, Aug 10, 2007 at 08:18:28AM -0400, ? ? wrote:
>
>> ? ? <ulion2002 <at> msn.com> writes:
>>
>> > I fixed it, and re-packed the patch into two diff, first is from svn 
>> diff
>> > for modified files, second is for the two new files.
>>
>> You can use svn add to diff new files. That's the way it should be done on 
>> this
>> list.
>>
> thank you very much. I just didn't figure it out how to use svn got patch 
> of new files.
>
> now I can merge two patch file into one, here is the patch.
>
> --- configure	(revision 24045)
> +++ configure	(working copy)
> @@ -3571,6 +3575,42 @@
>  fi 
>  echores "$_macosx_bundle"
>  
> +echocheck "Apple Remote"
> +if test "$_apple_remote" = auto ; then
> +  _apple_remote=no
> +  cat > $TMPC <<EOF
> +#include <stdio.h>
> +#include <IOKit/IOCFPlugIn.h>
> +int main (int argc, const char * argv[]) 
> +{
> +	io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
> +    CFMutableDictionaryRef hidMatchDictionary = NULL;
> +    IOReturn ioReturnValue = kIOReturnSuccess;

Random mix of tabs and spaces, same below.

> +	//If search is unsuccessful, print message and hang.
> +	if ((ioReturnValue != kIOReturnSuccess) | (hidObjectIterator == NULL)) {
> +//		printf("No matching HID class devices found.");

A commented-out printf in configure?

> +echores "$_apple_remote"
>  fi #if darwin

Leave that empty line in place please.

> --- input/ar.c	(revision 0)
> +++ input/ar.c	(revision 0)
> @@ -0,0 +1,283 @@
> +
> +#include <math.h>
> +#include <sysexits.h>
> +#include <IOKit/IOCFPlugIn.h>
> +#include <IOKit/hid/IOHIDLib.h>

New files should have a proper license header.

> +static int FindHIDDevices(mach_port_t masterPort, io_iterator_t *hidObjectIterator)
> +{
> +    CFMutableDictionaryRef hidMatchDictionary = NULL;
> +    IOReturn ioReturnValue = kIOReturnSuccess;
> +    
> +    // Set up a matching dictionary to search the I/O Registry by class
> +	// name for all HID class devices
> +	hidMatchDictionary = IOServiceMatching("AppleIRController");
> +
> + 	// Now search I/O Registry for matching devices.
> + 	ioReturnValue = IOServiceGetMatchingServices(masterPort, hidMatchDictionary, hidObjectIterator);
> +
> +	//If search is unsuccessful, print message and hang.
> +	if ((ioReturnValue != kIOReturnSuccess) | (*hidObjectIterator == NULL)) {
> +		return -1;
> +	}
> +	return 0;
> +}

Mixed tabs and spaces.  I prefer spaces.

> --- input/ar.h	(revision 0)
> +++ input/ar.h	(revision 0)
> @@ -0,0 +1,21 @@
> +
> +#ifndef __INPUT_AR_H_
> +#define __INPUT_AR_H_

same here, no license header

> --- input/Makefile	(revision 24045)
> +++ input/Makefile	(working copy)
> @@ -2,8 +2,9 @@
>  
> -SRCS_MPLAYER              = input.c
> -SRCS_MPLAYER-$(JOYSTICK) += joystick.c
> -SRCS_MPLAYER-$(LIRC)     += lirc.c
> +SRCS_MPLAYER                  = input.c
> +SRCS_MPLAYER-$(JOYSTICK)     += joystick.c
> +SRCS_MPLAYER-$(LIRC)         += lirc.c
> +SRCS_MPLAYER-$(APPLE_REMOTE) += ar.c

cosmetics

Diego



More information about the MPlayer-dev-eng mailing list