Commit e9e14b70 authored by Mikhail Karpenko's avatar Mikhail Karpenko

Merge branch 'index_ops'

 Conflicts:
	camogm.c
parents 30c6257b 928c20e9
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="0.531211255">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.531211255" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration buildProperties="" description="" id="0.531211255" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<folderInfo id="0.531211255." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.471666557" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.471666557.433608340" name=""/>
<builder id="org.eclipse.cdt.build.core.settings.default.builder.1922841623" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.702004608" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.1963286915" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.574933238" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.1479459009" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.854106261" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.910595191" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1738165492" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/linux-elphel/linux/source/include/elphel}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/linux-elphel/sysroots/elphel393/usr/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/linux-elphel/sysroots/elphel393/usr/include/ogg}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/linux-elphel/sysroots/elphel393-tcbootstrap/usr/include/linux}&quot;"/>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1943978810" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="elphel-apps-camogm.null.1205722733" name="elphel-apps-camogm"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="0.1398780877">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="0.531211255">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings">
<doc-comment-owner id="org.eclipse.cdt.ui.doxygen">
<path value=""/>
</doc-comment-owner>
</storageModule>
</cproject>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>camogm</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder (1).launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/bitbake apps-camogm -c fetch -f.launch</value>
</dictionary>
<dictionary>
<key>incclean</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/bitbake apps-camogm -c compile -f.launch</value>
</dictionary>
<dictionary>
<key>incclean</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
This source diff could not be displayed because it is too large. You can view the blob instead.
AXIS_USABLE_LIBS = UCLIBC GLIBC
AXIS_AUTO_DEPEND = yes
#include $(AXIS_TOP_DIR)/tools/build/Rules.axis
INSTDIR = $(prefix)/usr/local/sbin/
OTHERDIR = $(prefix)/usr/html/
PHPDIR = $(prefix)/usr/html/
INSTMODE = 0755
INSTOTHER = 0644
INSTPHP = 0644
INSTOWNER = root
INSTGROUP = root
INCDIR = $(prefix)/include
PROGS = camogm
PHPFILES = camogmstate.php
SRCS = camogm.c camogm_ogm.c camogm_jpeg.c camogm_mov.c camogm_kml.c
OBJS = camogm.o camogm_ogm.o camogm_jpeg.o camogm_mov.o camogm_kml.o
SRCS = camogm.c camogm_ogm.c camogm_jpeg.c camogm_mov.c camogm_kml.c camogm_read.c index_list.c
OBJS = camogm.o camogm_ogm.o camogm_jpeg.o camogm_mov.o camogm_kml.o camogm_read.o index_list.o
CFLAGS += -Wall -I$(ELPHEL_KERNEL_DIR)/include/elphel
#CFLAGS += -Wall -I$(INCDIR) -I$(ELPHEL_KERNEL_DIR)/include/elphel
LDLIBS += -logg -pthread -lm
all: $(PROGS)
$(PROGS): $(OBJS)
$(CC) $(LDFLAGS) $^ $(LDLIBS) -logg -o $@
install: $(PROGS)
$(INSTALL) -d $(INSTDIR)
$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) $(PROGS) $(INSTDIR)
#already installed with ccam.cgi
$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) qt_source $(prefix)/etc
$(INSTALL) -m $(INSTPHP) -o $(INSTOWNER) -g $(INSTGROUP) $(PHPFILES) $(PHPDIR)
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
clean:
rm -rf $(PROGS) *.o *~
configsubs:
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
/** @file camogm_jpeg.h
* @brief Provides writing to series of individual JPEG files for @e camogm
* @copyright Copyright (C) 2016 Elphel, Inc.
*
* @par <b>License</b>
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CAMOGM_JPEG_H
#define _CAMOGM_JPEG_H
#include "camogm.h"
int camogm_init_jpeg(void);
int camogm_init_jpeg(camogm_state *state);
int camogm_start_jpeg(camogm_state *state);
int camogm_frame_jpeg(camogm_state *state);
int camogm_end_jpeg(void);
int camogm_end_jpeg(camogm_state *state);
void camogm_free_jpeg(void);
#endif /* _CAMOGM_JPEG_H */
This diff is collapsed.
/** @file camogm_kml.h
* @brief Provides writing to series of individual KML files for @e camogm
* @copyright Copyright (C) 2016 Elphel, Inc.
*
* @par <b>License</b>
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CAMOGM_KML_H
#define _CAMOGM_KML_H
......
This diff is collapsed.
/** @file camogm_mov.h
* @brief Provides writing to file compatible with Apple Quicktime(R) for @e camogm
* @copyright Copyright (C) 2016 Elphel, Inc.
*
* @par <b>License</b>
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CAMOGM_MOV_H
#define _CAMOG_MOV_H
......
This diff is collapsed.
/** @file camogm_ogm.h
* @brief Provides writing to OGM files for @e camogm
* @copyright Copyright (C) 2016 Elphel, Inc.
*
* @par <b>License</b>
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CAMOGM_OGM_H
#define _CAMOGM_OGM_H
......
This diff is collapsed.
/** @file camogm_read.h
* @brief Provides reading data written to raw device storage and saving the data to a device with file system.
* @copyright Copyright (C) 2016 Elphel, Inc.
*
* <b>License:</b>
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CAMOGM_READ_H
#define _CAMOGM_READ_H
#include "camogm.h"
/**
* @struct range
* @brief Container for offsets in raw device buffer
* @var range::from
* Starting offset
* @var range::to
* Ending offset
*/
struct range {
uint64_t from;
uint64_t to;
};
void *reader(void *arg);
#endif /* _CAMOGM_READ_H */
/** @file index_list.c
* @brief Provides data structures and functions for working with disk index directory
* @copyright Copyright (C) 2016 Elphel, Inc.
*
* <b>License:</b>
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include "index_list.h"
/**
* @brief Create a new node in a linked list of disk indexes
* @param[in,out] index pointer to a newly allocated structure
* @return 0 in case a new disk index structure was successfully created and -1 otherwise
*/
int create_node(struct disk_index **index)
{
if (*index != NULL)
return -1;
*index = malloc(sizeof(struct disk_index));
if (*index != NULL) {
memset(*index, 0, sizeof(struct disk_index));
return 0;
} else {
return -1;
}
}
/**
* @brief Add a new index node to disk index directory
* @param[in,out] idir pointer to disk index directory
* @param[in] index pointer to index node to be added to disk index directory
* @return The number of entries in disk index directory
*/
int add_node(struct disk_idir *idir, struct disk_index *index)
{
if (idir->head == NULL && idir->tail == NULL) {
idir->head = index;
idir->tail = index;
idir->size = 1;
} else {
index->prev = idir->tail;
idir->tail->next = index;
idir->tail = index;
idir->size++;
}
return idir->size;
}
/**
* @brief Insert new node in chronological order
* @param[in,out] idir index directory to which a new node should be added
* @param[in] indx a pointer to new node
* @return The number of nodes in the directory
*/
int insert_node(struct disk_idir *idir, struct disk_index *indx)
{
int ret = 0;
struct disk_index *node;
if (idir->head == NULL) {
add_node(idir, indx);
return 1;
}
node = idir->head;
while (node != NULL) {
if (indx->rawtime < node->rawtime) {
ret = insert_prev(idir, node, indx);
break;
}
node = node->next;
}
if (node == NULL)
ret = insert_next(idir, idir->tail, indx);
return ret;
}
/**
* @brief Insert new index to the list before the index specified. It means that new index will
* be inserted toward the head.
* @param[in,out] idir pointer to the lined list of indexes
* @param[in] parent pointer to the element before which the new element will be inserted
* @param[in] new_indx pointer to the element which will be inserted
* @return The number of nodes in the list
*/
int insert_prev(struct disk_idir *idir, struct disk_index *parent, struct disk_index *new_indx)
{
if (parent->prev != NULL) {
new_indx->next = parent;
new_indx->prev = parent->prev;
parent->prev->next = new_indx;
parent->prev = new_indx;
} else {
new_indx->next = parent;
new_indx->prev = NULL;
parent->prev = new_indx;
idir->head = new_indx;
}
idir->size++;
return idir->size;
}
/**
* @brief Insert new index to the list after the index specified. It means that new index will
* be inserted toward the tail.
* @param[in,out] idir pointer to the linked list of indexes
* @param[in] parent pointer to the element after which the new element will be inserted
* @param[in] new_indx pointer to the element which will be inserted
* @return The number of nodes in the list
*/
int insert_next(struct disk_idir *idir, struct disk_index *parent, struct disk_index *new_indx)
{
if (parent->next != NULL) {
new_indx->next = parent->next;
new_indx->prev = parent;
parent->next->prev = new_indx;
parent->next = new_indx;
} else {
new_indx->next = NULL;
new_indx->prev = parent;
parent->next = new_indx;
idir->tail = new_indx;
}
idir->size++;
return idir->size;
}
/**
* @brief Find index node by its start offset
* @param[in] idir pointer to disk index directory
* @param[in] offset the offset of the file which should be found
* @return pointer to disk index node or NULL if the corresponding file was not found
*/
struct disk_index *find_by_offset(const struct disk_idir *idir, uint64_t offset)
{
struct disk_index *index = idir->head;
while (index != NULL) {
if (index->f_offset == offset)
break;
index = index->next;
}
return index;
}
/** @brief Find index node by its time stamp
* @param[in] idir pointer to disk index directory
* @param[in] time the time stamp of the file which should be found
* @return pointer to disk index node or NULL if the corresponding file was not found
*/
struct disk_index *find_nearest_by_time(const struct disk_idir *idir, time_t time)
{
struct disk_index *ptr = NULL;
struct disk_index *index = idir->head;
if (idir->size == 0)
return NULL;
if (index->next != NULL)
ptr = index->next;
else
return index;
while (index != NULL) {
if (fabs(difftime(index->rawtime, time)) < fabs(difftime(ptr->rawtime, time)))
ptr = index;
index = index->next;
}
return ptr;
}
/**
* @brief Remove a single index node from disk index directory
* @param[in,out] idir pointer to disk index directory
* @param[in] node pointer to the index node which should be removed
* @return The number of entries in disk index directory
*/
int remove_node(struct disk_idir *idir, struct disk_index *node)
{
if (node == NULL)
return -1;
if (node == idir->head) {
idir->head = node->next;
idir->head->prev = NULL;
} else if (node == idir->tail) {
idir->tail = node->prev;
idir->tail->next = NULL;
} else {
struct disk_index *ind = idir->head;
while (ind != NULL) {
if (ind == node) {
ind->prev->next = ind->next;
ind->next->prev = ind->prev;
break;
}
ind = ind->next;
}
}
free(node);
node = NULL;
idir->size--;
return idir->size;
}
/**
* @brief Remove all entries from disk index directory an free memory
* @param[in] idir pointer to disk index directory
* @return 0 in case the directory was successfully deleted and -1 if the directory was empty
*/
int delete_idir(struct disk_idir *idir)
{
struct disk_index *curr_ind;
struct disk_index *next_ind;
if (idir == NULL || idir->head == NULL)
return -1;
curr_ind = idir->head;
next_ind = curr_ind->next;
while (curr_ind != NULL) {
free(curr_ind);
curr_ind = next_ind;
if (curr_ind != NULL)
next_ind = curr_ind->next;
}
idir->head = idir->tail = NULL;
idir->size = 0;
return 0;
}
/** @file index_list.h
* @brief Provides data structures and functions for working with disk index directory
* @copyright Copyright (C) 2016 Elphel, Inc.
*
* <b>License:</b>
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef _INDEX_LIST_H
#define _INDEX_LIST_H
#include <stdint.h>
/**
* @struct disk_index
* @brief Contains a single entry into disk index directory. Each node in
* the disk index directory corresponds to a file in the raw device buffer and
* hold its starting offset, sensor port number, time stamp and file size.
* @var disk_index::next
* Pointer to the next index node
* @var disk_index::prev
* Pointer to the previous disk index node
* @var disk_index::rawtime
* Time stamp in UNIX format
* @var disk_index::usec
* The microsecond part of the time stamp
* @var disk_index::port
* The sensor port number this frame was captured from
* @var disk_index::f_size
* File size in bytes
* @var disk_index::f_offset
* The offset of the file start in the raw device buffer (in bytes)
*/
struct disk_index {
struct disk_index *next;
struct disk_index *prev;
time_t rawtime;
unsigned int usec;
uint32_t port;
size_t f_size;
uint64_t f_offset;
};
/**
* @struct disk_idir
* @brief Contains pointers to disk index directory
* @var disk_idir::head
* Pointer to the first node of disk index directory
* @var disk_idir::tail
* Pointer to the last node of disk index directory
* @var disk_idir::size
* The number of nodes in disk index directory
*/
struct disk_idir {
struct disk_index *head;
struct disk_index *tail;
struct disk_index *curr_indx;
size_t size;
};
void dump_index_dir(const struct disk_idir *idir);
int create_node(struct disk_index **index);
int add_node(struct disk_idir *idir, struct disk_index *index);
int insert_prev(struct disk_idir *idir, struct disk_index *parent, struct disk_index *new_indx);
int insert_next(struct disk_idir *idir, struct disk_index *parent, struct disk_index *new_indx);
int insert_node(struct disk_idir *idir, struct disk_index *indx);
struct disk_index *find_by_offset(const struct disk_idir *idir, uint64_t offset);
struct disk_index *find_nearest_by_time(const struct disk_idir *idir, time_t time);
int remove_node(struct disk_idir *idir, struct disk_index *node);
int delete_idir(struct disk_idir *idir);
#endif /* _INDEX_LIST_H */
/** @file ogmstreams.h */
#ifndef __OGGSTREAMS_H
#define __OGGSTREAMS_H
/*
/**
* Taken from http://tobias.everwicked.com/packfmt.htm
*
First packet (header)
---------------------
pos | content | description
-------+-------------------------+----------------------------------
0x0000 | 0x01 | indicates 'header packet'
-------+-------------------------+----------------------------------
0x0001 | stream_header | the size is indicated in the
| | size member
Second packet (comment)
-----------------------
pos | content | description
-------+-------------------------+----------------------------------
0x0000 | 0x03 | indicates 'comment packet'
-------+-------------------------+----------------------------------
0x0001 | data | see vorbis doc on www.xiph.org
Data packets
------------
pos | content | description
---------+-------------------------+----------------------------------
0x0000 | Bit0 0 | indicates data packet
| Bit1 Bit 2 of lenbytes |
| Bit2 unused |
| Bit3 keyframe |
| Bit4 unused |
| Bit5 unused |
| Bit6 Bit 0 of lenbytes |
| Bit7 Bit 1 of lenbytes |
---------+-------------------------+----------------------------------
0x0001 | LowByte | Length of this packet in samples
| ... | (frames for video, samples for
| HighByte | audio, 1ms units for text)
---------+-------------------------+----------------------------------
0x0001+ | data | packet contents
lenbytes | |
*
* First packet (header)
* ---------------------
*
* pos | content | description
* -------|-------------------------|----------------------------------
* 0x0000 | 0x01 | indicates 'header packet'
* 0x0001 | stream_header | the size is indicated in the
* &nbsp; | &nbsp; | size member
*
*
* Second packet (comment)
* -----------------------
*
* pos | content | description
* -------|-------------------------|----------------------------------
* 0x0000 | 0x03 | indicates 'comment packet'
* 0x0001 | data | see vorbis doc on www.xiph.org
*
*
* Data packets
* ------------
*
* pos | content | description
* ---------|-------------------------|----------------------------------
* 0x0000 | Bit0 0 | indicates data packet
* &nbsp; | Bit1 Bit 2 of lenbytes | &nbsp;
* &nbsp; | Bit2 unused | &nbsp;
* &nbsp; | Bit3 keyframe | &nbsp;
* &nbsp; | Bit4 unused | &nbsp;
* &nbsp; | Bit5 unused | &nbsp;
* &nbsp; | Bit6 Bit 0 of lenbytes | &nbsp;
* &nbsp; | Bit7 Bit 1 of lenbytes | &nbsp;
* 0x0001 | LowByte | Length of this packet in samples
* &nbsp; | ... | (frames for video, samples for
* &nbsp; | HighByte | audio, 1ms units for text)
* 0x0001+ | data | packet contents
* lenbytes | &nbsp; | &nbsp;
*
*/
//// OggDS headers
// Header for the new header format
/** OggDS headers */
/** Header for the new header format */
typedef struct stream_header_video {
ogg_int32_t width;
ogg_int32_t height;
......@@ -121,4 +117,4 @@ typedef struct old_stream_header {
#define PACKET_LEN_BITS2 0x02
#define PACKET_IS_SYNCPOINT 0x08
#endif /* __OGGSTREAMS_H */
#endif /* __OGGSTREAMS_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment