libdvr: Libdvr enhancement: an alternative way to generate index time by using system time. [1/1]

PD#SWPL-75327

Problem:
A libdvr funtion enhancement mainly for supporting an alternative time source,
that is system time or system clock, for PVR index time.
Original way is to use DVB PCR as time source. An drawback for this manner is
that during signal loss platform is not able to receive PCR and in development
environment short streams always be used which can loop easily. This will lead
to the difficulty to calculate actual recording time based on easy-looped PCR
especially under signal loss condition.

Solution:
To solve the problem, system time/clock is used as an alternative time source.
Specifically, Linux API clock_gettime(CLOCK_MONOTONIC) is applied to get the
time which will not be affected by signal loss and not have the loop problem.
A user controllable option called "force_sysclock" is also introduced to
control libdvr behavior. libdvr has 2 index_type: DVR_INDEX_TYPE_PCR,
DVR_INDEX_TYPE_LOCAL_CLOCK. With "force_sysclock" on, only
DVR_INDEX_TYPE_LOCAL_CLOCK index_type can be in use. With "force_sysclock"
off, libdvr is able to determine the type based on actual situation that is
system has PCR or not.
In libdvr development, the 2nd index_type DVR_INDEX_TYPE_LOCAL_CLOCK will be
supported carefully as described above. In addition to libdvr, a number of
other modules are affected including AML_MP/DTVKIT to make "force_sysclock"
available to App developpers. To reduce impact, DTVKIT will give a default
value to "force_sysclock" so that App developpers will not need to update
their codes in most conditinos.

Verify:
Locally tested ok in AH212/AM301 environment.

Signed-off-by: Wentao.MA <wentao.ma@amlogic.com>
Change-Id: I4f00963537e0c3d4dc3816cec5d38ccfb19e36e3
7 files changed
tree: cb2226a2bf21a414c09eca016e25c33526dbbe34
  1. include/
  2. src/
  3. test/
  4. Android
  5. Android.bp
  6. Android.mk
  7. Doxyfile
  8. LICENSE
  9. Makefile