This is patch 2 out of 3 that addresses the issue with detecting carrier loss.

The first one added the raise-by-omission mechanism required for the NO_CARRIER
event to function properly on formats like MPEG-TS, this second one adds the
NO_CARRIER event itself, and the third provides an implementation for MPEG-TS.

AVSTREAM_EVENT_FLAG_NO_CARRIER is an event indicating that no carrier was
present during the last call. In order to properly support connectionless
formats, it is distinct from the stream being dead or there being no "user data"
on the stream.

Due to the nature of the whole business it's up to the user to determine what
the event means. There is no way for libavformat to know whether it's good or
bad, but the user needs to know something's happened.

Regards,
John Högberg
From 244d21c41b8b9c3eba711742669fd3b9393d3e1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20H=C3=B6gberg?= <john.hogb...@ericsson.com>
Date: Mon, 18 May 2015 11:18:08 +0200
Subject: [PATCH] lavf: add an event for detecting carrier loss

AVSTREAM_EVENT_FLAG_NO_CARRIER is an event indicating that no carrier was
present during the last call. It is distinct from the stream being dead or there
being no data on the stream.
---
 libavformat/avformat.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index df18709..038c9fb 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -816,6 +816,11 @@ typedef struct AVStream {
      */
     int event_flags;
 #define AVSTREAM_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in 
updated metadata.
+#define AVSTREAM_EVENT_FLAG_NO_CARRIER       0x0002 /**< No carrier for this 
stream was present during the call.
+                                                         This is distinct from 
there being no data or the stream
+                                                         being dead; it simply 
means that the stream had no
+                                                         presence at all 
during the last call, and it's up to
+                                                         the caller to 
interpret what this means. */
 
     /*****************************************************************
      * All fields below this line are not part of the public API. They
-- 
2.1.0
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to