aboutsummaryrefslogtreecommitdiff
path: root/nodes/pvmp4ffcomposernode/src/pvmp4ffcn_node.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-03-25 01:06:57 -0700
committerJames Dong <jdong@google.com>2010-03-25 01:43:35 -0700
commit94d15606702ba7469bbb71739df707bfce1c4c3a (patch)
tree8723dfe4481f30b9565db2bbd489be0d4035dceb /nodes/pvmp4ffcomposernode/src/pvmp4ffcn_node.cpp
parent947cd0b2c2aa45819a3460d794f039ea4ce0dce2 (diff)
downloadopencore-94d15606702ba7469bbb71739df707bfce1c4c3a.tar.gz
The file writer thread is not thread-safe.
We can run into problem where deallocate() called from two separate thread which breaks PV's thread model where every task is scheduled to run within a single omx thread. I am pretty sure that this is why the free chunk available notification is lost sometimes; however, this is certainly not the fix to all the problems that we have seen so far. bug - 2484098 Change-Id: I88bc494a11ffd739bc5771fa75b4643de503714f
Diffstat (limited to 'nodes/pvmp4ffcomposernode/src/pvmp4ffcn_node.cpp')
-rw-r--r--nodes/pvmp4ffcomposernode/src/pvmp4ffcn_node.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/nodes/pvmp4ffcomposernode/src/pvmp4ffcn_node.cpp b/nodes/pvmp4ffcomposernode/src/pvmp4ffcn_node.cpp
index a5e5be37f..7905c7507 100644
--- a/nodes/pvmp4ffcomposernode/src/pvmp4ffcn_node.cpp
+++ b/nodes/pvmp4ffcomposernode/src/pvmp4ffcn_node.cpp
@@ -19,6 +19,34 @@
* @file pvmp4ffcn_node.cpp
* @brief Node for PV MPEG4 file format composer
*/
+
+/*
+ * FIXME:
+ * The current implementation of the file writer is NOT
+ * thread-safe.
+ *
+ * A separate delete queue should be used to
+ * pass back the fragments from the file writer thread
+ * to the composer node and to let the composer node
+ * handle the deallocation of any fragments; otherwise,
+ * race condition may occur. Some lost free chunk
+ * notification has been found due to this race
+ * condition.
+ *
+ * The reason why there is race condition is that the
+ * rest of the OpenCore assumes a single-thread model.
+ * In other words, everything is scheduled to
+ * run within a single omx thread. A separate file writer
+ * thread breaks this model, and deallocate fragments
+ * here may cause deallocate() be called within two
+ * separate thread, and thus the free chunk available
+ * flag can be corrupted.
+ *
+ * Don't remove the following #undef line unless you
+ * fix the above issue.
+ */
+#undef ANDROID
+
#ifdef ANDROID
// #define LOG_NDEBUG 0
#define LOG_TAG "PvMp4Composer"