moin moin,

On 2010-08-16 11:26, Burkhard Plaum wrote:
> 
> The os.c was added by august while porting gmerlin-avdecoder to windows.
> 
> I just found another problem: For the semaphores, the implementation is 
> missing
> as well. For linux, we can use the system supplied semaphores. But for OSX,
> the sem_* functions are present but non-working. This basically means
> that using RTSP on OSX doesn't work right now.

right, at closer inspection i was wondering how this was supposed to
work....

> 
>>
>> the base64.c is a little bit more complicated, as it is the sole
>> implementation of the base64 encoders/decoders, and it's only available
>> under BSD (in the gmerlin project of course)
>>
>> it would be necessary to replace the entire file by GPL'ed code.
>>
>> would it be ok if i create a patch that would implement these changes?
> 
> Yes, if you find a GPLed drop-in replacement for base64 en-/decoding, that
> would be great.

i found something even simpler:
http://mediatools.cs.ucl.ac.uk/nets/mmedia/browser/common/trunk/src/base64.c
is a 3-clause BSD version of the (original) base64.c (actually they only
asked the license holders whether it is ok to change the license to
3-clause BSD and got permission).


> 
>> something i should take special care of?
> 
> base64 is used for http authentication and some RTSP variants, so these should
> work afterwards.
> 

i haven't checked, as i don't have any media to check.

anyhow, attached is a changeset that:
- uses the 3-clause BSD license as basis for the base64.c file
- moves the BSD-licensed code in os.c and bgav_sem.h into separate files
(without adding any functionality; so the semaphores are still as broken
as they were)


fgmasdr
IOhannes
diff -Naur gmerlin_avdecoder.org//include/bgav_sem.h 
gmerlin_avdecoder/include/bgav_sem.h
--- gmerlin_avdecoder.org//include/bgav_sem.h   2010-08-16 11:41:23.000000000 
+0200
+++ gmerlin_avdecoder/include/bgav_sem.h        2010-08-16 11:00:39.000000000 
+0200
@@ -27,108 +27,6 @@
 
 #else // Use BSD Implementation
 
-/* See original copyright below. */
-/* NOTE: On systems, which have non-working versions
-   of these functions in their libc, only the -export-symbols-regex
-   of libtool prevents clashes */
-
-
-/* Begin thread_private.h kluge */
-/*
- * These come out of (or should go into) thread_private.h - rather than have 
- * to copy (or symlink) the files from the source tree these definitions are 
- * inlined here.  Obviously these go away when this module is part of libc.
-*/
-
-struct sem {
-#define SEM_MAGIC       ((uint32_t) 0x09fa4012)
-        uint32_t       magic;
-        pthread_mutex_t lock;
-        pthread_cond_t  gtzero;
-        uint32_t       count;
-        uint32_t       nwaiters;
-};
-
-#ifndef _SEMAPHORE_H_
-#define _SEMAPHORE_H_
-
-/*
- * $Id: bgav_sem.h,v 1.3 2010/01/14 18:37:07 gmerlin Exp $
- *
- * semaphore.h: POSIX 1003.1b semaphores
-*/
-
-/*-
- * Copyright (c) 1996, 1997
- *     HD Associates, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by HD Associates, Inc
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/posix4/semaphore.h,v 1.6 2000/01/20 07:55:42 jasone Exp $
- */
-
-#include <limits.h>
-
-#include <sys/types.h>
-#include <fcntl.h>
-
-/* Opaque type definition. */
-struct sem;
-typedef struct sem *sem_t;
-
-#define SEM_FAILED     ((sem_t *)0)
-
-#ifndef SEM_VALUE_MAX
-#define SEM_VALUE_MAX  UINT_MAX
-#endif
-
-#ifndef KERNEL
-#ifndef _WIN32
-#include <sys/cdefs.h>
-#else
-#define __P(protos) protos 
-#define __BEGIN_DECLS
-#define __END_DECLS
-#endif
-
-__BEGIN_DECLS
-int     sem_init __P((sem_t *, int, unsigned int));
-int     sem_destroy __P((sem_t *));
-sem_t  *sem_open __P((const char *, int, ...));
-int     sem_close __P((sem_t *));
-int     sem_unlink __P((const char *));
-int     sem_wait __P((sem_t *));
-int     sem_trywait __P((sem_t *));
-int     sem_post __P((sem_t *));
-int     sem_getvalue __P((sem_t *, int *));
-__END_DECLS
-#endif /* KERNEL */
-
-#endif /* _SEMAPHORE_H_ */
+#include <bgav_sem_bsd.h>
 
 #endif // HAVE_POSIX_SEMAPHORES
diff -Naur gmerlin_avdecoder.org//include/Makefile.am 
gmerlin_avdecoder/include/Makefile.am
--- gmerlin_avdecoder.org//include/Makefile.am  2010-08-16 11:41:14.000000000 
+0200
+++ gmerlin_avdecoder/include/Makefile.am       2010-08-16 11:02:04.000000000 
+0200
@@ -9,6 +9,7 @@
 avdec_private.h \
 bgav_dca.h \
 bgav_sem.h \
+bgav_sem_bsd.h \
 bgav_vdpau.h \
 bitstream.h \
 bsf.h \
diff -Naur gmerlin_avdecoder.org//lib/base64.c gmerlin_avdecoder/lib/base64.c
--- gmerlin_avdecoder.org//lib/base64.c 2010-08-16 11:43:45.000000000 +0200
+++ gmerlin_avdecoder/lib/base64.c      2010-08-16 11:31:35.000000000 +0200
@@ -16,24 +16,21 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by the Computer Science
- *      Department at University College London
- * 4. Neither the name of the University nor of the Department may be used
- *    to endorse or promote products derived from this software without
- *    specific prior written permission.
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 3. Neither the names of the copyright holders nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
+ * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  *
  * Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
  * 
@@ -52,19 +49,17 @@
 
 /* Taken from mpeg4ip CVS and changed to fit into this library */
 
+/* 2010-08-16 [IOhannes m zmoelnig]: rebased the code on
+ * http://mediatools.cs.ucl.ac.uk/nets/mmedia/browser/common/trunk/src/base64.c
+ * (revision:4412), which is released under the 3-clause BSD style license 
(with
+ * explicit permission of the copyright holders) - thus it is now GPL 
compatible
+ */
+
 #define ASSERT(cond) \
 if(!(cond)) return 0
 
 #include <avdec_private.h>
 
-#if 0 /* gmerlin_avdecoder */
-#include "config_unix.h"
-#include "config_win32.h"
-#include "debug.h"
-#include "base64.h"
-#endif
-
-#if 1 /* gmerlin_avdecoder */
 static const unsigned char basis_64[] = 
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
 int bgav_base64encode(const unsigned char *input, int input_length, unsigned 
char *output, int output_length)
@@ -98,7 +93,6 @@
   return j;
   }
 
-#endif
 
 /* This assumes that an unsigned char is exactly 8 bits. Not portable code! 
:-) */
 static const unsigned char index_64[128] = {
diff -Naur gmerlin_avdecoder.org//lib/Makefile.am 
gmerlin_avdecoder/lib/Makefile.am
--- gmerlin_avdecoder.org//lib/Makefile.am      2010-08-16 11:43:52.000000000 
+0200
+++ gmerlin_avdecoder/lib/Makefile.am   2010-08-16 10:53:11.000000000 +0200
@@ -498,6 +498,7 @@
 nanosoft.c \
 options.c \
 os.c \
+os_inet_aton.c \
 packetbuffer.c \
 packetpool.c \
 packettimer.c \

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Gmerlin-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gmerlin-general

Reply via email to