Skip to content

Commit

Permalink
Bug 1841766 - Vendor libogg using mach vendor r=kinetik
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-sans-paille committed Jul 5, 2023
1 parent f1a8a9a commit 60eb26e
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 82 deletions.
118 changes: 76 additions & 42 deletions media/libogg/README
Original file line number Diff line number Diff line change
@@ -1,77 +1,71 @@
********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2011 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************

= WHAT'S HERE =
# Ogg

[![Travis Build Status](https://travis-ci.org/xiph/ogg.svg?branch=master)](https://travis-ci.org/xiph/ogg)
[![Jenkins Build Status](https://mf4.xiph.org/jenkins/job/libogg/badge/icon)](https://mf4.xiph.org/jenkins/job/libogg/)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/xiph/ogg?branch=master&svg=true)](https://ci.appveyor.com/project/rillian/ogg)

Ogg project codecs use the Ogg bitstream format to arrange the raw,
compressed bitstream into a more robust, useful form. For example,
the Ogg bitstream makes seeking, time stamping and error recovery
possible, as well as mixing several sepearate, concurrent media
streams into a single physical bitstream.

## What's here ##
This source distribution includes libogg and nothing else. Other modules
(eg, the modules libvorbis, vorbis-tools for the Vorbis music codec,
libtheora for the Theora video codec) contain the codec libraries for
use with Ogg bitstreams.

Directory:

./src The source for libogg, a BSD-license inplementation of
the public domain Ogg bitstream format
- `src` The source for libogg, a BSD-license inplementation of the public domain Ogg bitstream format

./include Library API headers
- `include` Library API headers

./doc Ogg specification and libogg API documents
- `doc` Ogg specification and libogg API documents

./win32 Win32 projects and build automation
- `win32` Win32 projects and build automation

./macosx Mac OS X project and build files
- `macosx` Mac OS X project and build files

= WHAT IS OGG? =
## Contact ##

Ogg project codecs use the Ogg bitstream format to arrange the raw,
compressed bitstream into a more robust, useful form. For example,
the Ogg bitstream makes seeking, time stamping and error recovery
possible, as well as mixing several sepearate, concurrent media
streams into a single physical bitstream.

= CONTACT =

The Ogg homepage is located at 'https://www.xiph.org/ogg/'.
The Ogg homepage is located at https://www.xiph.org/ogg/ .
Up to date technical documents, contact information, source code and
pre-built utilities may be found there.

BUILDING FROM TARBALL DISTRIBUTIONS:
## Building ##

#### Building from tarball distributions ####

./configure
make
./configure
make

and optionally (as root):
make install

make install

This will install the Ogg libraries (static and shared) into
/usr/local/lib, includes into /usr/local/include and API
documentation into /usr/local/share/doc.

BUILDING FROM REPOSITORY SOURCE:
#### Building from repository source ####

A standard svn build should consist of nothing more than:

./autogen.sh
make
./autogen.sh
./configure
make

and as root if desired :

make install
make install

BUILDING ON WIN32:
#### Building on Windows ####

Use the project file in the win32 directory. It should compile out of the box.

CROSS COMPILING FROM LINUX TO WIN32:
#### Cross-compiling from Linux to Windows ####

It is also possible to cross compile from Linux to windows using the MinGW
cross tools and even to run the test suite under Wine, the Linux/*nix
Expand All @@ -86,12 +80,52 @@ Once these tools are installed its possible to compile and test by
executing the following commands, or something similar depending on
your system:

./configure --host=i586-mingw32msvc --target=i586-mingw32msvc \
--build=i586-linux
./configure --host=i586-mingw32msvc --target=i586-mingw32msvc --build=i586-linux
make
make check

(Build instructions for Ogg codecs such as vorbis are similar and may
be found in those source modules' README files)

$Id: README 18096 2011-09-22 23:32:51Z giles $
## Building with CMake ##

Ogg supports building using [CMake](http://www.cmake.org/). CMake is a meta build system that generates native projects for each platform.
To generate projects just run cmake replacing `YOUR-PROJECT-GENERATOR` with a proper generator from a list [here](http://www.cmake.org/cmake/help/v3.2/manual/cmake-generators.7.html):

cmake -G YOUR-PROJECT-GENERATOR .

Note that by default cmake generates projects that will build static libraries.
To generate projects that will build dynamic library use `BUILD_SHARED_LIBS` option like this:

cmake -G YOUR-PROJECT-GENERATOR -DBUILD_SHARED_LIBS=1 .

After projects are generated use them as usual

#### Building on Windows ####

Use proper generator for your Visual Studio version like:

cmake -G "Visual Studio 12 2013" .

#### Building on Mac OS X ####

Use Xcode generator. To build framework run:

cmake -G Xcode -DBUILD_FRAMEWORK=1 .

#### Building on Linux ####

Use Makefile generator which is default one.

cmake .
make

## License ##

THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.
USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS
GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE
IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.

THE OggVorbis SOURCE CODE IS COPYRIGHT (C) 1994-2015
by the Xiph.Org Foundation https://www.xiph.org/
8 changes: 0 additions & 8 deletions media/libogg/README_MOZILLA

This file was deleted.

16 changes: 8 additions & 8 deletions media/libogg/memory-reporting.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Date: Wed Mar 5 10:58:29 2014 -0500

Bug 677653 - part 1 - indirect libogg memory allocations through variables

diff --git a/media/libogg/include/ogg/ogg.h b/media/libogg/include/ogg/ogg.h
diff --git a/include/ogg/ogg.h b/include/ogg/ogg.h
index cea4ebe..cebe38e 100644
--- include/ogg/ogg.h
+++ include/ogg/ogg.h
--- a/include/ogg/ogg.h
+++ b/include/ogg/ogg.h
@@ -202,6 +202,10 @@ extern int ogg_page_packets(const ogg_page *og);

extern void ogg_packet_clear(ogg_packet *op);
Expand All @@ -19,10 +19,10 @@ index cea4ebe..cebe38e 100644

#ifdef __cplusplus
}
diff --git a/media/libogg/include/ogg/os_types.h b/media/libogg/include/ogg/os_types.h
diff --git a/include/ogg/os_types.h b/include/ogg/os_types.h
index 2c75a20..83ed732 100644
--- include/ogg/os_types.h
+++ include/ogg/os_types.h
--- a/include/ogg/os_types.h
+++ b/include/ogg/os_types.h
@@ -17,12 +17,33 @@
#ifndef _OS_TYPES_H
#define _OS_TYPES_H
Expand Down Expand Up @@ -63,11 +63,11 @@ index 2c75a20..83ed732 100644

#if defined(_WIN32)

diff --git a/media/libogg/src/ogg_alloc.c b/media/libogg/src/ogg_alloc.c
diff --git a/src/ogg_alloc.c b/src/ogg_alloc.c
new file mode 100644
index 0000000..4238d7b
--- /dev/null
+++ src/ogg_alloc.c
+++ b/src/ogg_alloc.c
@@ -0,0 +1,31 @@
+/********************************************************************
+ * *
Expand Down
97 changes: 97 additions & 0 deletions media/libogg/moz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
schema: 1

bugzilla:
product: Core
component: "Audio/Video"

origin:
name: libogg
description: multimedia container format

url: https://www.xiph.org/ogg/

release: v1.3.3 (2017-11-07T12:38:19-08:00).
revision: v1.3.3

license: BSD-3-Clause
license-file: COPYING

vendoring:
url: https://gitlab.xiph.org/xiph/ogg/
source-hosting: gitlab
tracking: tag

exclude:
- ".*"
- "*"
- "**"

keep:
- geckoextra
- sources.mozbuild

include:
- "include/ogg/config_types.h.in"
- "include/ogg/ogg.h"
- "include/ogg/os_types.h"
- "src/bitwise.c"
- "src/framing.c"
- AUTHORS
- CHANGES
- COPYING
- README.md

update-actions:
- action: move-file
from: '{vendor_dir}/README.md'
to: '{vendor_dir}/README'
- action: move-file
from: '{vendor_dir}/src/bitwise.c'
to: '{vendor_dir}/src/ogg_bitwise.c'
- action: move-file
from: '{vendor_dir}/src/framing.c'
to: '{vendor_dir}/src/ogg_framing.c'
- action: delete-path
path: '{vendor_dir}/win32/.gitignore'

# Manually reproduce configure step here
- action: replace-in-file
pattern: '@INCLUDE_INTTYPES_H@'
with: '1'
file: '{vendor_dir}/include/ogg/config_types.h.in'
- action: replace-in-file
pattern: '@INCLUDE_STDINT_H@'
with: '1'
file: '{vendor_dir}/include/ogg/config_types.h.in'
- action: replace-in-file
pattern: '@INCLUDE_SYS_TYPES_H@'
with: '1'
file: '{vendor_dir}/include/ogg/config_types.h.in'
- action: replace-in-file
pattern: '@SIZE16@'
with: 'int16_t'
file: '{vendor_dir}/include/ogg/config_types.h.in'
- action: replace-in-file
pattern: '@USIZE16@'
with: 'uint16_t'
file: '{vendor_dir}/include/ogg/config_types.h.in'
- action: replace-in-file
pattern: '@SIZE32@'
with: 'int32_t'
file: '{vendor_dir}/include/ogg/config_types.h.in'
- action: replace-in-file
pattern: '@USIZE32@'
with: 'uint32_t'
file: '{vendor_dir}/include/ogg/config_types.h.in'
- action: replace-in-file
pattern: '@SIZE64@'
with: 'int64_t'
file: '{vendor_dir}/include/ogg/config_types.h.in'
- action: move-file
from: '{vendor_dir}/include/ogg/config_types.h.in'
to: '{vendor_dir}/include/ogg/config_types.h'

patches:
- solaris-types.patch
- memory-reporting.patch
- ogg-fuzzing.patch
6 changes: 3 additions & 3 deletions media/libogg/ogg-fuzzing.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# Parent 2388cab0a545d744bd109fa3a7af3b22a3dc4ced
Bug 1561256 - Disable CRC checks in ogg framing for FUZZING. r=drno

diff --git a/media/libogg/src/ogg_framing.c b/media/libogg/src/ogg_framing.c
--- a/media/libogg/src/ogg_framing.c
+++ b/media/libogg/src/ogg_framing.c
diff --git a/src/ogg_framing.c b/src/ogg_framing.c
--- a/src/ogg_framing.c
+++ b/src/ogg_framing.c
@@ -287,34 +287,38 @@ static int _os_lacing_expand(ogg_stream_
}

Expand Down
4 changes: 2 additions & 2 deletions media/libogg/solaris-types.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Index: include/ogg/os_types.h
===================================================================
--- include/ogg/os_types.h (revision 18100)
+++ include/ogg/os_types.h (working copy)
--- a/include/ogg/os_types.h (revision 18100)
+++ b/include/ogg/os_types.h (working copy)
@@ -75,6 +75,16 @@
typedef uint32_t ogg_uint32_t;
typedef int64_t ogg_int64_t;
Expand Down
19 changes: 0 additions & 19 deletions media/libogg/update.sh

This file was deleted.

0 comments on commit 60eb26e

Please sign in to comment.