Skip to content

Commit

Permalink
Merge branch 'master' into new-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Beirdo committed May 20, 2011
2 parents d62cc57 + ee692b1 commit 85ebada
Show file tree
Hide file tree
Showing 54 changed files with 709 additions and 360 deletions.
26 changes: 16 additions & 10 deletions mythtv/configure
Expand Up @@ -108,8 +108,8 @@ Advanced options (experts only):
--disable-firewire disable support for FireWire cable boxes
--disable-iptv disable support for recording RTSP/UDP/RTP streams
--disable-hdhomerun disable support for HDHomeRun boxes
--disable-v4l disable Video4Linux support
--disable-ivtv disable ivtv support (PVR-x50) req. v4l support
--disable-v4l2 disable Video4Linux support
--disable-ivtv disable ivtv support (PVR-x50) req. v4l2 support
--disable-hdpvr disable HD-PVR support
--disable-dvb disable DVB support
--dvb-path=HDRLOC location of directory containing
Expand Down Expand Up @@ -1357,7 +1357,8 @@ MYTHTV_CONFIG_LIST='
qtdbus
qtwebkit
quartz_video
v4l
v4l2
v4l1
valgrind
x11
xrandr
Expand Down Expand Up @@ -1763,15 +1764,16 @@ audio_oss_deps_any="soundcard_h sys_soundcard_h"
dvb_deps="backend"
firewire_deps="backend"
iptv_deps="backend"
ivtv_deps="backend v4l"
hdpvr_deps="backend v4l"
ivtv_deps="backend v4l2"
hdpvr_deps="backend v4l2"
hdhomerun_deps="backend"
mpegtsraw_demuxer_deps="merge_libavformat_mpegts_c"
mythtranscode_deps="backend frontend"
opengl_deps_any="agl_h GL_gl_h GLES2_gl2_h darwin windows x11"
opengles_deps="GLES2_gl2_h"
opengl_video_deps="opengl"
v4l_deps="backend linux_videodev_h linux_videodev2_h"
v4l2_deps="backend linux_videodev2_h"
v4l1_deps="backend v4l2 linux_videodev_h"
vdpau_deps="opengl vdpau_vdpau_h vdpau_vdpau_x11_h"
xrandr_deps="x11"
xv_deps="x11"
Expand Down Expand Up @@ -1993,10 +1995,12 @@ enable opengles
enable opengl_video
enable quartz_video
enable symbol_visibility
enable v4l
enable v4l1
enable v4l2
enable x11
enable xrandr
enable xv
disable indevs

# mythtv paths
dvb_path_default="${sysroot}/usr/include"
Expand Down Expand Up @@ -3120,7 +3124,8 @@ EOF
disable mmx
enable disable_mmx_for_debugging # prevent later call to die
fi
disable v4l
disable v4l1
disable v4l2
disable x11
# Workaround compile errors from missing gmtime_r/localtime_r/uint def
CFLAGS=`echo $CFLAGS | sed 's/-D_POSIX_C_SOURCE=200112//'`
Expand Down Expand Up @@ -3165,7 +3170,8 @@ EOF
disable protocols
fi
disable symver
disable v4l
disable v4l1
disable v4l2
enable windows
disable x11
###### Standard ffmpeg configure stuff follows:
Expand Down Expand Up @@ -4446,7 +4452,7 @@ enabled stripping || strip="echo skipping strip"
config_files="$TMPH $TMPMAK"

if enabled backend; then
echo "Video4Linux sup. ${v4l-no}"
echo "Video4Linux sup. ${v4l2-no} (v1 ${v4l1-no})"
echo "ivtv support ${ivtv-no}"
echo "HD-PVR support ${hdpvr-no}"
echo "FireWire support ${firewire-no}"
Expand Down
24 changes: 24 additions & 0 deletions mythtv/libs/libmythbase/mythcorecontext.cpp
Expand Up @@ -6,6 +6,7 @@
#include <QMutex>
#include <QThread>
#include <QWaitCondition>
#include <QNetworkInterface>

#include <cmath>

Expand Down Expand Up @@ -167,6 +168,19 @@ bool MythCoreContext::Init(void)
return false;
}

has_ipv6 = false;

// If any of the IPs on any interfaces look like IPv6 addresses, assume IPv6
// is available
QNetworkInterface interface;
QList<QHostAddress> IpList = interface.allAddresses();
for (int i = 0; i < IpList.size(); i++)
{
if (IpList.at(i).toString().contains(":"))
has_ipv6 = true;
};


return true;
}

Expand Down Expand Up @@ -542,6 +556,16 @@ bool MythCoreContext::IsFrontendOnly(void)
return !backendOnLocalhost;
}

QString MythCoreContext::MythHostAddressAny(void)
{

if (has_ipv6)
return QString("::");
else
return QString("0.0.0.0");

}

QString MythCoreContext::GenMythURL(QString host, QString port, QString path, QString storageGroup)
{
return GenMythURL(host,port.toInt(),path,storageGroup);
Expand Down
4 changes: 4 additions & 0 deletions mythtv/libs/libmythbase/mythcorecontext.h
Expand Up @@ -81,6 +81,8 @@ class MBASE_PUBLIC MythCoreContext : public MythObservable, public MythSocketCBs
uint timeout_ms = kMythSocketLongTimeout,
bool error_dialog_desired = false);

QString MythHostAddressAny(void);

QString GenMythURL(QString host = QString(), QString port = QString(),
QString path = QString(), QString storageGroup = QString());

Expand Down Expand Up @@ -160,6 +162,8 @@ class MBASE_PUBLIC MythCoreContext : public MythObservable, public MythSocketCBs
private:
MythCoreContextPrivate *d;

bool has_ipv6;

void connected(MythSocket *sock) { (void)sock; }
void connectionFailed(MythSocket *sock) { (void)sock; }
void connectionClosed(MythSocket *sock);
Expand Down
10 changes: 7 additions & 3 deletions mythtv/libs/libmythbluray/bdnav/meta_parse.c
Expand Up @@ -31,9 +31,12 @@

#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <errno.h>

#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif

#ifdef HAVE_LIBXML2
#include <libxml/parser.h>
#include <libxml/xmlmemory.h>
Expand Down Expand Up @@ -114,6 +117,7 @@ static void _findMetaXMLfiles(META_ROOT *meta, const char *device_path)
meta->dl_entries[i].filename = str_printf("%s", ent.d_name);
strncpy(meta->dl_entries[i].language_code, ent.d_name+5,3);
meta->dl_entries[i].language_code[3] = '\0';
str_tolower(meta->dl_entries[i].language_code);
}
}
dir_close(dir);
Expand Down Expand Up @@ -187,15 +191,15 @@ META_DL *meta_get(META_ROOT *meta_root, const char *language_code)

if (language_code) {
for (i = 0; i < meta_root->dl_count; i++) {
if (strcasecmp(language_code, meta_root->dl_entries[i].language_code) == 0) {
if (strcmp(language_code, meta_root->dl_entries[i].language_code) == 0) {
return &meta_root->dl_entries[i];
}
}
BD_DEBUG(DBG_DIR, "requested disclib language '%s' not found\n", language_code);
}

for (i = 0; i < meta_root->dl_count; i++) {
if (strcasecmp(DEFAULT_LANGUAGE, meta_root->dl_entries[i].language_code) == 0) {
if (strcmp(DEFAULT_LANGUAGE, meta_root->dl_entries[i].language_code) == 0) {
BD_DEBUG(DBG_DIR, "using default disclib language '"DEFAULT_LANGUAGE"'\n");
return &meta_root->dl_entries[i];
}
Expand Down
69 changes: 22 additions & 47 deletions mythtv/libs/libmythbluray/bdnav/navigation.c
Expand Up @@ -388,6 +388,7 @@ _extrapolate_title(NAV_TITLE *title)
static void _fill_clip(NAV_TITLE *title,
MPLS_CLIP *mpls_clip,
uint8_t connection_condition, uint32_t in_time, uint32_t out_time,
unsigned pi_angle_count,
NAV_CLIP *clip,
unsigned ref, uint32_t *pos, uint32_t *time)

Expand All @@ -396,13 +397,20 @@ static void _fill_clip(NAV_TITLE *title,

clip->title = title;
clip->ref = ref;
clip->angle = 0;

if (title->angle >= pi_angle_count) {
clip->angle = 0;
} else {
clip->angle = title->angle;
}

strncpy(clip->name, mpls_clip[clip->angle].clip_id, 5);
strncpy(&clip->name[5], ".m2ts", 6);
clip->clip_id = atoi(mpls_clip[clip->angle].clip_id);

path = str_printf("%s"DIR_SEP"BDMV"DIR_SEP"CLIPINF"DIR_SEP"%s.clpi",
title->root, mpls_clip[clip->angle].clip_id);
clpi_free(clip->cl);
clip->cl = clpi_parse(path, 0);
X_FREE(path);
if (clip->cl == NULL) {
Expand Down Expand Up @@ -432,7 +440,7 @@ static void _fill_clip(NAV_TITLE *title,
*time += clip->out_time - clip->in_time;
}

NAV_TITLE* nav_title_open(const char *root, const char *playlist)
NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle)
{
NAV_TITLE *title = NULL;
char *path;
Expand All @@ -451,7 +459,7 @@ NAV_TITLE* nav_title_open(const char *root, const char *playlist)
path = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "PLAYLIST" DIR_SEP "%s",
root, playlist);
title->angle_count = 0;
title->angle = 0;
title->angle = angle;
title->pl = mpls_parse(path, 0);
if (title->pl == NULL) {
BD_DEBUG(DBG_NAV, "Fail: Playlist parse %s\n", path);
Expand All @@ -472,7 +480,8 @@ NAV_TITLE* nav_title_open(const char *root, const char *playlist)

clip = &title->clip_list.clip[ii];

_fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, clip, ii, &pos, &time);
_fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, pi->angle_count,
clip, ii, &pos, &time);
}

// sub paths
Expand All @@ -493,7 +502,8 @@ NAV_TITLE* nav_title_open(const char *root, const char *playlist)
MPLS_SUB_PI *pi = &title->pl->sub_path[ss].sub_play_item[ii];
NAV_CLIP *clip = &sub_path->clip_list.clip[ii];

_fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, clip, ii, &pos, &time);
_fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, 0,
clip, ii, &pos, &time);
}
}
}
Expand All @@ -511,6 +521,11 @@ NAV_TITLE* nav_title_open(const char *root, const char *playlist)
title->mark_list.mark = calloc(title->pl->mark_count, sizeof(NAV_MARK));

_extrapolate_title(title);

if (title->angle >= title->angle_count) {
title->angle = 0;
}

return title;
}

Expand Down Expand Up @@ -744,7 +759,6 @@ NAV_CLIP* nav_next_clip(NAV_TITLE *title, NAV_CLIP *clip)

NAV_CLIP* nav_set_angle(NAV_TITLE *title, NAV_CLIP *clip, unsigned angle)
{
char *path;
int ii;
uint32_t pos = 0;
uint32_t time = 0;
Expand All @@ -770,48 +784,9 @@ NAV_CLIP* nav_set_angle(NAV_TITLE *title, NAV_CLIP *clip, unsigned angle)

pi = &title->pl->play_item[ii];
clip = &title->clip_list.clip[ii];
if (title->angle >= pi->angle_count) {
clip->angle = 0;
} else {
clip->angle = title->angle;
}

clpi_free(clip->cl);

clip->ref = ii;
strncpy(clip->name, pi->clip[clip->angle].clip_id, 5);
strncpy(&clip->name[5], ".m2ts", 6);
clip->clip_id = atoi(pi->clip[clip->angle].clip_id);

path = str_printf("%s"DIR_SEP"BDMV"DIR_SEP"CLIPINF"DIR_SEP"%s.clpi",
title->root, pi->clip[clip->angle].clip_id);
clip->cl = clpi_parse(path, 0);
X_FREE(path);
if (clip->cl == NULL) {
clip->start_pkt = 0;
clip->end_pkt = 0;
continue;
}
switch (pi->connection_condition) {
case 5:
case 6:
clip->start_pkt = 0;
clip->connection = CONNECT_SEAMLESS;
break;
default:
clip->start_pkt = clpi_lookup_spn(clip->cl, pi->in_time, 1,
pi->clip[clip->angle].stc_id);
clip->connection = CONNECT_NON_SEAMLESS;
break;
}
clip->end_pkt = clpi_lookup_spn(clip->cl, pi->out_time, 0,
pi->clip[clip->angle].stc_id);
clip->in_time = pi->in_time;
clip->out_time = pi->out_time;
clip->pos = pos;
pos += clip->end_pkt - clip->start_pkt;
clip->start_time = time;
time += clip->out_time - clip->in_time;
_fill_clip(title, pi->clip, pi->connection_condition, pi->in_time, pi->out_time, pi->angle_count,
clip, ii, &pos, &time);
}
_extrapolate_title(title);
return clip;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbluray/bdnav/navigation.h
Expand Up @@ -141,7 +141,7 @@ struct nav_title_list_s

BD_PRIVATE uint8_t nav_lookup_aspect(NAV_CLIP *clip, int pid);
BD_PRIVATE char* nav_find_main_title(const char *root);
BD_PRIVATE NAV_TITLE* nav_title_open(const char *root, const char *playlist);
BD_PRIVATE NAV_TITLE* nav_title_open(const char *root, const char *playlist, unsigned angle);
BD_PRIVATE void nav_title_close(NAV_TITLE *title);
BD_PRIVATE NAV_CLIP* nav_next_clip(NAV_TITLE *title, NAV_CLIP *clip);
BD_PRIVATE NAV_CLIP* nav_packet_search(NAV_TITLE *title, uint32_t pkt, uint32_t *clip_pkt,
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbluray/bdnav/uo_mask_table.h
Expand Up @@ -67,7 +67,7 @@ static inline BD_UO_MASK bd_uo_mask_combine(BD_UO_MASK a, BD_UO_MASK b)
unsigned i;

for (i = 0; i < sizeof(BD_UO_MASK); i++) {
po[i] = pa[i] & pb[i];
po[i] = pa[i] | pb[i];
}

return o;
Expand Down

0 comments on commit 85ebada

Please sign in to comment.