MPEG4Writer:use 64bit version fallocate/ftruncate

MediaServer runs as 32-bit process(b/126502613).  When MediaRecorder
is used, MPEG4Writer threads run on that process. fallocate(2)'s
parameters off_t offset and off_t len were compiled as 32bit types
which overflows after 2Gibi bytes.  Same happens for ftruncate() too.
Hence, using 64bit version of those functions.

Bug: 158810394

Test: atest android.media.cts.MediaMuxerTest \
        android.mediav2.cts.MuxerTest \
        android.mediav2.cts.MuxerUnitTest \
        android.media.cts.MediaRecorderTest \
        android.mediastress.cts.MediaRecorderStressTest \
        android.mediastress.cts.MediaMuxerStressTest
Change-Id: Ib0e29dc14e7f3b5f2c20c0bf34650ea96107d946
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index 39423c7..90a0777 100644
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -566,7 +566,7 @@
         release();
     }
 
-    if (fallocate(mFd, FALLOC_FL_KEEP_SIZE, 0, 1) == 0) {
+    if (fallocate64(mFd, FALLOC_FL_KEEP_SIZE, 0, 1) == 0) {
         ALOGD("PreAllocation enabled");
         mPreAllocationEnabled = true;
     } else {
@@ -1862,7 +1862,7 @@
     ALOGV("preAllocateSize :%" PRIu64 " lastFileEndOffset:%" PRIu64, preAllocateSize,
           lastFileEndOffset);
 
-    int res = fallocate(mFd, FALLOC_FL_KEEP_SIZE, lastFileEndOffset, preAllocateSize);
+    int res = fallocate64(mFd, FALLOC_FL_KEEP_SIZE, lastFileEndOffset, preAllocateSize);
     if (res == -1) {
         ALOGE("fallocate err:%s, %d, fd:%d", strerror(errno), errno, mFd);
         sp<AMessage> msg = new AMessage(kWhatFallocateError, mReflector);
@@ -1889,7 +1889,7 @@
     ALOGD("ftruncate mPreAllocateFileEndOffset:%" PRId64 " mOffset:%" PRIu64
           " mMdatEndOffset:%" PRIu64 " diff:%" PRId64, mPreAllocateFileEndOffset, mOffset,
           mMdatEndOffset, mPreAllocateFileEndOffset - endOffset);
-    if(ftruncate(mFd, endOffset) == -1) {
+    if (ftruncate64(mFd, endOffset) == -1) {
         ALOGE("ftruncate err:%s, %d, fd:%d", strerror(errno), errno, mFd);
         status = false;
         /* No need to post and handle(stop & notify client) error like it's done in preAllocate(),